5 Tools to Test, Decode, Analyze and Build Regular Expressions or RegEx

A search function can be found on nearly every application to help the user find a text or even files from computer. The most basic search function is to search for the exact matching string which is very limited. The more advanced user would know how to use a wildcard by using an asterisk or question mark character in the search. For example, if the searcher is trying to find a text or file with the name raymond but he doesn’t know the full spelling, he could just search ray* which will return any results that starts with ray.

The most advanced algorithm for search would be regular expression, or some people just calls it regex. Regular expression is just a string that describes a search pattern. It can be very precise in the sense that you can use it to search for an email address format, a URL, or anything at all as long as you can define the correct regular expression. Hence it is often used in verifying input in a submission form, web scraping, htaccess redirects and etc.

regex

Regular expression can be very interesting because the same purpose can be achieved using a different pattern. How the regular expression pattern is written is based on how good the person is in regular expression and also how specific you want it to be. Writing regular expression is not easy without learning it. So here are some resources that can help you analyze and write better regex pattern. 1. Regular Expression Library

There is no need to waste your precious time in learning about regular expression if you just need a pattern, say for email verification in a form. All you need to do is just visit the Regular Expression Library website and search in their database that currently has 3420 regular expressions that’s free to use.

regular expression library

For example, you can find 38 different patterns that can be used to identify an email address format. You will need to read the description of the regex pattern and also check the sample of matching and non-matching data for a clearer picture.

Visit Regular Expression Library


2. Regex Hero

While there are so many online regular expression tools that provides real time highlighting of regex matches, Regex Hero is one of our favorite because it comes with a very useful benchmark feature. As we’ve said before that different regex pattern can be used to match a string, we can easily and quickly know which performs better using the benchmark feature found in Regex Hero.

benchmark-regular-expression-pattern

As you can see from the screenshot above, the second pattern is 1,051.9% slower than the first pattern although they both matches a string of given text. Generally speaking, the longer regex runs faster. Regex Hero requires Silverlight to run.

Visit Regex Hero


3. RegexMagic

RegexMagic is a shareware that helps to generate regular expressions without the need to know any of the regex syntax. While most people would advise that you should know regular expressions to write one, RegexMagic is probably the only tool that tries to get around this.

regexmagic

Do not think that RegexMagic will automatically generate regular expressions by itself. You will still need to learn how to use it because some parts of the program such as the different kinds of field and pattern matching might not be easily understood especially for beginners. Nevertheless, it is still easier than having to manually write a regex pattern by referring to a cheat sheet. The trial version of RegexMagic is fully functional for 7 days.

Download RegexMagic


4. Online Regex Builder

While there are rarely any regular expression builder that automatically generates regular expression based on given data, SEQREL logXtender is the only one with a free online service that magically build a regex string to match the input.

online regex builder

This is probably what every person who wants to build a regular expression but doesn’t how to do it wants to use. The only problem with such automated regex builder is that the generated regex cannot be very precise, hence there might be a performance hit since it’s not optimized. Nevertheless, it is still a very good regex tool to quickly generate a working regex without knowing anything about it.

Visit Online Regex Builder


5. txt2re

There are many online regular expression tools that are useful to analyze an existing regular expression to see if it matches a certain given text. With txt2re, it works the other way round where you provide the text and it tries to find recognizable patterns and allowing you to choose the available patterns to use.

txt2re

To help you understand better in which pattern to select, you can move your mouse cursor on top of the underlined characters and it will show you if you’d like to match against a single character, match against double quote string, match against variable name and etc.

Visit txt2re

You might also like:

6 Comments - Write a Comment

  1. hyena 8 years ago
  2. bahirzaheri8 8 years ago
  3. Firas 8 years ago
  4. hooly 8 years ago
  5. utkarsh30june 8 years ago
  6. dino 8 years ago

Leave a Reply

Your email address will not be published. Required fields are marked *

Note: Your comment is subject to approval. Read our Terms of Use. If you are seeking additional information on this article, please ask in our forum or contact us directly.