Tag Archives: regularexpressions

May 31, 2011

text2re

This system acts as a regular expression generator. Instead of trying to build the regular expression, you start off with the string that you want to search. You paste this into the site, click submit and the site finds recognisable patterns in your string. You then select the patterns that you are interested in and it writes a fully fledged program that extracts those patterns from that string.

A time-saver if ever I saw one.

November 27, 2009

John Gruber's regex for matching URLs

This pattern attempts to be practical. It makes no attempt to parse URLs according to any official specification. It isn’t limited to predefined URL protocols. It should be clever about things like parentheses and trailing punctuation.

URLs are notoriously difficult to match with regular expressions. This seems to be a pretty accurate implementation, I’ve yet to have it fail.