Regular expressions match text to a pattern and optionally collect portions of text referred to as groups. eXPL regular expressions are implemented using the Java Pattern class.
Format
A regular expression declaration has format:
regex(regular-expression [ { group-name [ , group-name ... ] } ] ).
This declaration is placed immediately following the term to be matched and the regex short circuits unification if the match fails. Note that the regular expression may be contained in a string variable so it does not clutter the declaration. The optional groups are implemented as terms which are inserted in the template following the match term.
Here is an example of a term named "Definition" which matches to a single text string an collects 2 group items named "part" (for "part of speech") and "def" for "definition". Sample Definition: "n. a positive motivational influence":
