IDM PowerTips

Regular Expression Builder

Regular Expressions are essentially patterns, rather than literal strings, that are used to compare/match text in Find/Replace operations. As an example, the * character in a Perl regular expression matches the preceding character or expression zero or more times.

While regular expressions are a powerful addition to your text-editing toolkit, the syntax can be difficult to remember. So, the Find/Replace dialogs include a Regular Expression Builder which allow you to quickly create and execute complex regular expressions – without requiring you to consult the help to “remember” the proper syntax.

Regular Expression Builder

You can access the Regular Expression Builder – in the find/replace dialogs – by clicking on the right arrow icon by the input fields:

Note: In order to use the Regular Expression Builder, you will need to enable the “Regular Expressions” checkbox on the Find/Replace dialog. Also note, you can switch the regular expression engine in the Advanced options – click the Advanced button to expand the advanced options.

How does it work? Simply click on the items to build your expression…

For instance, we are viewing a log file and are looking for all lines that include the word “error”, we can use the Regular Expression Builder to create our search string.

1. Select “Start of line”

2. Select “Any single character”

3. Select “Zero or more” – because the “any character” will repeat.

4. Type our string, “error”

5. Again, select “Any single character” and “Zero or more”.

6. Select “End of line”

Your expression is complete. You’ve created an expression that says (essentially) start at the beginning of the line, match any character, match the word “error”, match any character, match the end of the line – in other words, find any line that includes “error”.

Click the Next button to search your file…