M
makoto kuwata
Hi, all.
Is it possible to specify start position of Regexp matching?
str = "foo bar baz"
m = /ba/.match(str)
p m.begin(0) #=> 4
m = /ba/.match(str, 5) # is it possible?
p m.begin(0) #=> 8 (if possible)
If it is possible, some kind of parser or scanner can be
implemented easily.
# StringScanner is a litte too big, I think.
Is it possible to specify start position of Regexp matching?
str = "foo bar baz"
m = /ba/.match(str)
p m.begin(0) #=> 4
m = /ba/.match(str, 5) # is it possible?
p m.begin(0) #=> 8 (if possible)
If it is possible, some kind of parser or scanner can be
implemented easily.
# StringScanner is a litte too big, I think.