Regex is a special utility in text paring, but sometimes it may seems complex and puzzling. To help you to write efficient, long and correct regex'es, Regex Match Tracer has many special designs for regex editing, testing and debuging.
First, Regex Match Tracer provides a visual environment to let the regex clear to read and understand. Then Regex Match Tracer provides a set of powerful functions to help you to write a correct regex, such as trace, locate fail point etc.
1. Show regex in colorized text
The regex is displayed in colorized text, this makes your regex clear to read and understand. For example:
While mouse clicks or cursor moves, the current node at the cursor is highlighted by a yellow background. The current node is also highlighted in the "tree structure" and "groups" synchronously.
2. Show regex in tree structure synchronously
The components of regex is shown in tree structure to make the regex is more clear to understand. While regex is editing in "regex edit box", the tree structure is updated synchronously.
While mouse clicks or arrow key pressed, the corresponding node at "regex edit box" and "groups" is selected synchronously.
3. Centralized groups and their capture contents
Capture groups are listed together. If match success, the captured contents are displayed in details.
While mouse clicks or arrow keys pressed, the corresponding node in the "regex edit box" and "tree structure" is selected synchronously. The corresponding captured text is selected in the text box.
4. Record the time elapsed of every match
Every match result is recorded with time elapsed, accurate to 0.0000001 seconds.
Since Regex Match Tracer trace more information than a regex is matching in program, the time elapsed is a bit longer than it is in program.
5. Test only one node in a long regex
One part of a long regex can be tested individually for debugging. To test only one node, select the menu Match > Only current node.
If you want to begin testing at a certain position, click the position in text box and then select the menu Match > Set start point.
If you want the match must begin at the start point exactly, select the menu Match > Only start point.
6. Provide a gadget to save text clips
Regex Match Tracer provides a small box to save text clips for later use. You can drag and drop a piece of text in it, or you can paste from clipboard.
It is supported to set an alias for a text clip.
7. Snapshots let you modify & try regex freely
If you have gotten a successful regex, but you want to do some optimization, you can add current state as a snapshot. Then you will feel free to modify and try your regex without destroying your successful intermediate regex.
You can click the "Add snapshot" button on the toolbar or right click the "Snapshot Tree" box to add a snapshot.
8. Save regex and text as a project
The regex pattern, regex flags, text, "replace to pattern", and snapshots together can be saved into a project file. Then you can archive the project file or send to others for communication. For example, you can send to webmaster@regexlab.com for help if you meet a problem.
The project file ".rws" is associated with Regex Match Tracer, so you can double click a .rws file to open it.
9. Within regex, record attempt times of every node
The attempt times of every node are recorded for optimization. You can get to know which node has attempted the most times.
If you have a problem of efficiency, you can try to find out which node is the efficiency bottleneck.
10. Within regex, trace each node in match process
This is an important feature since V3.0.
Press F10 to trace into match process step by step, then you will get to know how does a regex match a text, or you can find out the fail reason of a unsuccessful match.
- A green background means a "successful attempt";
- A yellow background means "intermediate result";
- A red background means a "fail attempt";
- A grey background means a "backtrack";
11. Within regex, locate the match fail point node
This is an important feature since V3.0.
If a regex fails to match, Regex Match Tracer will tell you why it fails, which node in regex, where in the text fail to match.
The "locate fail point" can be disabled from menu Match > Locate fail point.
12. Save match result to text or csv
After successful matches, you can save matched strings to a text file or csv file. You can also save splitted result to a text file or csv file.
To save match result, right click text box and select "Save as" from the context menu. Then select a proper "Save type" at the Save as dialog.
13. Import from & export to program strings
Under "Tools" menu, there are some tools to convert between regex and program strings.
You can select to export regex into a program string. Or import regex from a program string. Or create a short demo program code to use the regex.