ruby on rails - how can we use preg_match_all()in RoR -


Is there any ROR method that can work similar to the preg_match_all () php function?

Scan:

  string = 'joe@example.com ; Walter@example.org 'result = string.scan (/ ([a-z0-9 _.-] +) @ ([a-z0-9 -] +) \. [Az.] + / I) P results Size # = & gt; 2 result # = & gt; Here [["which", "example"], ["Walter", "Example"]]  

Here's a good article:


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -