R
Robo
When I use String#match, it only seems to match the regex pattern once. How
do I tell it to match the pattern as many times as possible?
e.g. puts 'robo ruler ruby'.match(/r\w+/)
That only return 'robo', but I would like it to return [robo, ruler, ruby]
I tried using the /g modifier, but Ruby doesn't seem to know about that.
I'm doing this 'cos I'm trying to extract all the function names from a PHP
file, but I shouldn't have to tell it to search it line by line do I?
Robo
do I tell it to match the pattern as many times as possible?
e.g. puts 'robo ruler ruby'.match(/r\w+/)
That only return 'robo', but I would like it to return [robo, ruler, ruby]
I tried using the /g modifier, but Ruby doesn't seem to know about that.
I'm doing this 'cos I'm trying to extract all the function names from a PHP
file, but I shouldn't have to tell it to search it line by line do I?
Robo