![]() |
How to use RegExhibit |
|
Basic usage
Using RegExhibit should be reasonably straightforward. The main window has three tabs: find, replace and split. You enter a regular expression, and when you are replacing a replacement string, at the top. Next there is a space where you can set the modifiers for the regular expression.
The text you want to search through is in the middle. If your expression matches anything, it will show up there. The replace and split tabs also show the results of the replacement and splitting.
At the bottom of the main window you can see if there were any problems with the match. Here you can also toggle the details drawer, which shows more information on the results of a match.
Modifiers
You can influence the way a regular expression is interpretated or applied by setting one or more modifiers. Some of these can also be set from within a regular expression.
Modifier: |
Meaning: |
|||
Find all |
Instead of matching just the first item in a text, the regular expression will now match everywhere it can. When splitting a text, “find all” is always on. |
|||
Case-insensitive |
Ignore the difference in case when matching. When on, “ |
|||
Allow whitespace and comments |
Also known as “free flow mode”. |
|||
Match newline with dot |
Also known as “dot matches all mode”. |
|||
Treat strings as multiple lines |
Also known as “multiline mode”. |
|||
Unicode |
When set, character classes will include the relevant Unicode characters. For example, with the Unicode modifier set “ü” will be in |
Preferences
The Preferences window allows you to set the colours with which RegExhibit will show matches, captures, and replacements. You can also decide whether you want RegExhibit to underline matches, captures, and replacements. This can be useful when they contain spaces at their beginning or ending that you otherwise would not see.
If you want you can also tell RegExhibit to shade overlapping captures. When you do, characters that participate in more than one capture will have a darker background.
RegExhibit normally immediately shows you the results of any changes you make. Sometimes you will want more control over when RegExhibit performs a match, e.g. when you have a slow computer or are matching a long text. If you uncheck “Live matching”, RegExhibit will not match untill you press the “match” button on the main window.
Perl allows regular expressions to contain code blocks. This can be very useful, but is also dangerous if you don’t make sure your code is harmless. By default this option is disabled in RegExhibit. If you think you know what you are doing, you can enabled it by checking “Allow Perl code execution”.
Even when set, RegExhibit will disallow you to “print
” (or any of its variants) to STDOUT
. You can use “warn
”, but that will only cause RegExhibit to think the regular expression is invalid.