Development

Create, verify and visualize regular expressions with iHateRegex

Create, verify and visualize regular expressions with iHateRegex

Regular expressions, or regex, can be very powerful when it comes to find operations provided that programs or online services support them. Programs like TextConverter, PowerRename, or nnn support regular expressions, but using regular expressions can be intimidating or outright frustrating.

Take the following expression as an example: (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))3. If you are familiar with regular expressions, you may understand the expression right away. If you are not, you may have a hard time deciphering it (it detects IP addresses).

Crafting regular expressions can be very frustrating especially for users who just started to learn regular expressions.

The new website iHateRegex comes to the rescue. The site maintains a searchable database of regular expressions and includes a playground for testing regular expressions.

The search field on the project's startpage can be used to search the database of regular expressions. Select any to display the expression, example matches, and a visualization that highlights the expression's flow.

You can edit any of the regular expressions or example strings right away; results and the visualization are updated in real-time and it is quite easy to use the visualization and the matches to craft and verify regular expressions.

The playground works identical only that you are starting with a basic regular expression and visualization that you may modify to your liking. You may copy the expression or copy embed code, and even submit a new regular expression for evaluation and inclusion in the project's database.

Since you may edit any regular expression, you may also use copy and paste to copy regular expressions from other sites or applications to paste them on the iHateRegex site; this way, it is easy to edit, test and verify regular expressions.

Closing Words

There are plenty of sites on the Internet and programs that help understand, create and verify regular expressions. We reviewed the Windows software Regular Expression Coach in 2009 and it works to this day.

If there is one downside to iHateRegex it is the fact that you cannot just use the site if you are getting started. You need another resource such as Regexr or regular-expressions.info to learn the basics quickly. It would be great if the developer of the site would add some tutorials and quick help options to the site to assist users.

Now you: have you used regular expressions before?

SuperTuxKart for Linux
SuperTuxKart is a great title designed to bring you the Mario Kart experience free of charge on your Linux system. It is pretty challenging and fun to...
Battle for Wesnoth Tutorial
The Battle for Wesnoth is one of the most popular open source strategy games that you can play at this time. Not only has this game been in developmen...
0 A.D. Tutorial
Out of the many strategy games out there, 0 A.D. manages to stand out as a comprehensive title and a very deep, tactical game despite being open sourc...