L
loveajax
Hi,
I am not sure if this is possible. I have a case statement which
checks for a regular expression. For example:
case text
when /(abc)(.)*/
when /(xyz)(.)*/
end
In the above snippet how can I use the instance variables pre_match
and post_match? I tried calling these methods without any qualifiers
but I got a NoMethodError. Where does Ruby store the MatchData if the
matching is done in a case statement?
Thanks
-subbu
I am not sure if this is possible. I have a case statement which
checks for a regular expression. For example:
case text
when /(abc)(.)*/
when /(xyz)(.)*/
end
In the above snippet how can I use the instance variables pre_match
and post_match? I tried calling these methods without any qualifiers
but I got a NoMethodError. Where does Ruby store the MatchData if the
matching is done in a case statement?
Thanks
-subbu