[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [bug] String>>escapeRegex fails on Strings including an

From: Tim Felgentreff
Subject: [Help-smalltalk] [bug] String>>escapeRegex fails on Strings including an asterisk
Date: Sun, 13 Sep 2009 14:47:13 -0700

Issue status update for Post a follow up:

Project:      GNU Smalltalk
Version:      <none>
Component:    STInST
Category:     bug reports
Priority:     normal
Assigned to:  Unassigned
Reported by:  timfelgentreff
Updated by:   timfelgentreff
Status:       active

gst-convert fails with "Invalid index 1: index out of range" when trying
to convert methods have a '*' in their category to squeak. The reason is
that since b44ebba00d36fe7a3d112811f4617f5630ee55f4 escapeRegex is
called on the methodCategory.

As 'escapeRegex' should simply put backslashes in Front of regex
characters, why not use a simple

String>>escapeRegex [
^ '[][?*+\\()^$|]' inject: self into: [:str :char | str copyReplaceAll: char asString with: '\', char asString].

instead of the call to "copyFrom:to:replacingAllRegex:with:"? Wouldn't
that solve the problem?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]