Is it possible to get a complete list of matches made from a regular expression?
Here is an example of what I'm trying to do:
sTestStr = "exec Trace_p @Comment = 'this is a test string will it work?"
reTestRE = Regexp.new("(this|work)")
mdMatch = reTestRE.match(sTestStr)
puts mdMatch.to_a()
The output is:
this
this
So it looks like its matching the string twice, but I can't get access to the 'work' match. Can this be done?
Here is an example of what I'm trying to do:
sTestStr = "exec Trace_p @Comment = 'this is a test string will it work?"
reTestRE = Regexp.new("(this|work)")
mdMatch = reTestRE.match(sTestStr)
puts mdMatch.to_a()
The output is:
this
this
So it looks like its matching the string twice, but I can't get access to the 'work' match. Can this be done?