[Wtr-general] How to get the second part which is found by Regexp

Chris McMahon christopher.mcmahon at gmail.com
Mon Feb 6 10:48:53 EST 2006


>  re = /http\:\/\/[_a-zA-Z0-9-]+[\._a-zA-Z0-9-]+/
>  matches = line.scan( re )
>
>  It will return an array that contains everything you are looking for ...


Cool, I didn't know if scan returned an array (although I might have
suspected it, so many Ruby methods do.)

-Chris




More information about the Wtr-general mailing list