Hi All is there any RoR method which can work same as preg_match_all() php function?
A:
Use scan :
string = '[email protected]; [email protected]'
result = string.scan(/([a-z0-9_.-]+)@([a-z0-9-]+)\.[a-z.]+/i)
p result.size
# => 2
p result
# => [["joe", "example"], ["walter", "example"]]
there is a good article here: http://railsforphp.com/2008/01/17/regular-expressions-in-ruby/
Jesse
2010-06-15 08:10:36
i want output as ['[email protected]','[email protected]']
ashok
2010-06-15 08:41:34