Magic Regex Generator

txt2re.com: input the text you’d like to run a regex against, and then select the results you’d like returned, and presto! it provides the code in the language of your choice.

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. You then copy the program into your editor or IDE and play with it to integrate it into your program.

Amazing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.