Huh? When looking through the ri documentation for the "match" method on
the String class, it says it take the contents of the String and
converts it to a regexp before doing a match.
So...how come the two matches do not return the same result? And even
more importantly, how can I make sure that they do?
Huh? When looking through the ri documentation for the "match" method on
the String class, it says it take the contents of the String and
converts it to a regexp before doing a match.
Thanks Adam! Yeah...turns out I didn't read the ri docs carefully
enough.
On the String class, #match takes a regex and compares the original
string to that. On the Regexp class, #match takes a string and compares
the pattern to that string.