regexpBuilder() is GUI that aims to simplify the creation of regexps in Matlab. It shows exactly what the various outputs are for the given regexp, text, and input options as you type. All regexp constructs supported by Matlab are allowed, for help on regexps, see doc regexp. A demo is provided, in the help, look under 'Other Demos' -> 'rexpBuilder Demo' -> 'regexpBuilder' -> 'Using the regexpBuilder GUI' in Matlab versions up to R2011b and in 'Supplemental Software' in R2012a and up.
Enter your regexp in the textbox with "Regexp goes here...".
Optional inputs to the regexp command are enabled using the
checkboxes below. An unchecked box signifies the default is used for
that option. The text to be run on goes in the textbox marked "Text
to parse goes here".
If you click the Evaluate button, check one of the option
checkboxes, or simply type in either the Regexp or Text textboxes,
the regexp is run against the text and the results are printed in
the Output panel on the right. Each box corresponds to the
particular output of the regexp command. For example, the Match
textbox will contain the same information as [match] =
regexp(text,regexp,...,'match'), with the addition of the phrase
'Match #:' signifying which match it corresponds to. You can click
on the button with the Match label to obtain a bigger window for
If the regexp can match the text, each match is underlined in the
text and the entire regexp is underlined. If the regexp contains
tokens (named or unnamed), the definition of each token is
highlighted in the regexp and every match of the token is
highlighted in the text with the matching color. Thus, for a regexp
with many tokens that matches often, your text might look rather
rainbowy. If you would like to change the color scheme, see the
highlightText function in this file.
Lastly, if the you click the Evaluate button, along with the output
mentioned above, the arguments to the regexp command used are
printed to the Command Window in the form
output = regexp(TEXT,REGEXP, ARGUMENTS);