Re: [bug] aRegexResults at: n throws error if the captured at n is empty string

Mark Bratcher <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <type=project&nid=835&cid=681&[email protected]>
Issue status update for 
http://smalltalk.gnu.org/project/issue/835
Post a follow up: 
http://smalltalk.gnu.org/project/comments/add/835

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  sergio
 Updated by:   mbratch
 Status:       active

This is still a problem. Here's my related example:

st> m := 'a=' =~ '(.*?)=(.*)'
Object: Interval new "<-0x4ce2bdf0>" error: Invalid index 1: index out
of range
SystemExceptions.IndexOutOfRange(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.IndexOutOfRange class>>signalOn:withIndex:
(SysExcept.st:660)
Interval>>first (Interval.st:245)
Kernel.MatchingRegexResults>>at: (Regex.st:382)
Kernel.MatchingRegexResults>>printOn: (Regex.st:305)
Kernel.MatchingRegexResults(Object)>>printString (Object.st:534)
Kernel.MatchingRegexResults(Object)>>printNl (Object.st:571)


The regex `(.*?)=(.*)' should match `'a='` without an exception, and
then `m at: 2` should yield `nil`.

Full problem description is posted at Stackoverflow.com [1].
[1]
http://stackoverflow.com/questions/31116594/gst-regular-expression-misma...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.