|
|
|
|
|
by WestCoastJustin
4640 days ago
|
|
http://rubular.com/ is also really great! I use it often when programming ruby regular expressions. Fill in a batch of test strings into the box, then run your regular expression against it, and instantly see (visually) what is happening. This is a BIG plus coming from perl regex 10 years ago ;) This is not a dig a perl regex, but I just remember it was a trial and error loop, where I would continually be iterating the script to see if it worked, where as with this webpage, you just iterate, more quickly. They also have a great example: test string:
Today's date is: 9/28/2013.
regex:
(?<month>\d{1,2})\/(?<day>\d{1,2})\/(?<year>\d{4})
result:
month 9
day 28
year 2013
Screenshot here: http://i.imgur.com/ixyHRde.png |
|