If you got a lot of matches, you may want to navigate through them. This can be done by using the arrows in the views tool bar. Choose "Next Match" to move the selection to the next match. Choose "Previous Match" to go back to the previous match found. The result area will also show the match's relevant entries.
Another way to navigate to a certain match is to put the cursor inside a marked match or draw a selection on it. Then right click to see the context menu and choose Go To Match. Now the result area will show you the result data belonging to this particular match.
LiveEval is a comfortable way to continiously test your regex. If it is activated, everytime you change something in your regex the program re-evaluates it and shows its results. This also works if you do not touch the regex, but change the search text or choose any of the pattern flags. You always get a live feedback if your changes led to the right result or not.
You can also use the preferences dialog (Window > Preferences) to change this feature's behavior. Please refer to Preferences for details.
Menu Item | Java Pattern Flag | Description |
Canonical Equivalence | Pattern.CANON_EQ | When this flag is specified then two characters will be considered to match if, and only if, their full canonical decompositions match. |
Case Insensitive | Pattern.CASE_INSENSITIVE | Enables case-insensitive matching. |
Comments | Pattern.COMMENTS | Permits whitespace and comments in pattern. |
Dotall Mode | Pattern.DOTALL | In dotall mode, the expression . matches any character, including a line terminator. |
Multiline Mode | Pattern.MULTILINE | In multiline mode the expressions ^ and $ match just after or just before, respectively, a line terminator or the end of the input sequence. |
Unicode Case | Pattern.UNICODE_CASE | Enables Unicode-aware case folding. |
Unix Lines | Pattern.UNIX_LINES | In this mode, only the '\n' line terminator is recognized in the behavior of ., ^, and $. |
If you choose Pattern Flags > Deactivate All all selected flags will be removed. You can also use the preferences dialog (Window > Preferences) to select a number of default flags. Please refer to Preferences for details.
If you want to use your regular expression as a literal String in your Java code,
you might find yourself in trouble. Your trouble maker #1 here is the backslash ("\").
In Strings backslashes are used to escape certain kind of characters, e.g \n for a new line
or \t for a tab. Java only allows certain characters to be followed by a backslash.
So if you use any backslahes in your regular expression you will either get a compile
error because Java does not accept the following character or your regex will be
mis-interpreted. What you have to do is to escape every backslash with another backslash
so Java can safely ignore them, e.g. /(x/)
becomes //(x//)
.
To help you with this task, right click on your regular expression and choose Copy As String Literal. Now you can paste the escaped regex anywhere in your code.
If you would like additional help with code generation, you can also choose
Copy As Java Declaration from the regex's context menu. This will escape the
regex as described above and create the neccessary Java code. For example
if your regex is /(x/)
and you chose the pattern flag Dotall Mode
you will get Pattern.compile("//(x//)",Pattern.DOTALL);
which you can
paste anywhere you like.
You can change preferences by choosing Window > Preferences and selecting RegEx Tester. You can specify Default Pattern Flags which will be set every time the RegEx Tester plugin starts up. This has no effect on the currently set pattern flags. For the flag's detailed description please refer to Pattern Flags
In the Live Eval section of the preferences dialog you can change a number of settings related
to the live evaluation of regular expressions (LiveEval).
Currently there are 3 modes for Live Eval: