Now you can test your regular expression with Graphrex. As well as the unique visualization introduced in the first version, now with version 0.2 Graphrex enables you to run a regex against test text and get visual feedback about matches, capture groups and more.
This screenshot shows the new function. Notice the visualization in the Graphrex editor. The corresponding regular expression can be entered and edited (with error highlighting) in the Regex view below the editor. Now on the same view you can enter the text to test the regex against. Run the test with the run button.
Any text that is matched by the regular expression is annotated with green squiggly underlines when you run the test, and its location is marked in the margin and on the overview ruler on the right. If you have capture groups in your regex, as in the screen shot, you can hover over a match to see what was captured by each group.
If you put the text cursor in one of the match annotations (e.g. by clicking on it) the annotation becomes selected as shown by the green background. Capture groups that have captured text for the selected match will be highlighted, in the both the diagram and the outline view, and the captured text will be shown. In the diagram it appears in the title bar of the capture group box, and in the outline view it shows up in a new Matched text column.
The Regex view remembers the test text you type in. (It is stored with the Eclipse metadata).
Other enhancements in version 0.2
- Regular expressions containing newlines and certain other characters are now correctly restored when a Graphrex diagram is saved and re-opened.
- The fields in the Regex view now use a unicode font.
- The Outline view is improved to be more readable.
- A bug with Save As was fixed.