Are we suppose to use regex with for loop?
For example If I want to ensure the user entering bunch of email in a text-box in the format like below, What is the best way to do it ?
Zoo bbb <zoo@email.com>, Alan T <at@gmail.xxx>, ........
How do we extract the information and put in names[], emails[].?
If you wanted to use regex the following pattern would match:
You can test it out on: http://rubular.com
What you would do is count the matches found by using
scanhere is the example code i put together
output: