The SPAN_REGEXP Tag

The SPAN_REGEXP rule is similar to the SPAN rule except the start sequence is taken to be a regular expression. In addition to the attributes supported by the SPAN tag, the HASH_CHAR attribute must be specified. It must be set to the first character that the regular expression matches. Note that this disallows regular expressions which can match more than one character at the start position.

Regular expression syntax is described in Appendix E.

Here is a SPAN_REGEXP rule that highlights constructs placed between <#ftl and >, as long as the <#ftl is followed by a word break:

<SPAN_REGEXP TYPE="KEYWORD1" HASH_CHAR="&lt;" DELEGATE="EXPRESSION">
    <BEGIN>&lt;#ftl\&gt;</BEGIN>
    <END>&gt;</END>
</SPAN_REGEXP>