Regexp
Regexp block - style definition with open and close tag defined as regular expressions. Much more powerful than Block but also much more slower.
<Blocks> <Regexp open="'" open_lead="[^\w\)'\]]" close="'"/> </Blocks>
Attributes
open
Obligatory attribute, defining regular expression starting syntax block. Shall be unique through all styles allowed in open container. Block can have only one open tag. You can not use regular expression lookahead/ lookbehind - use open_lead/open_trail attributes instead.
open_lead
Reverse regular expression, which shall lead regular expression given in open tag. Use as replacement for lookabehind.
open_trail
Regular expression, which shall trail regular expression given in open tag. Use as replacement for lookahead.
close
Optional attribute, defining regular expression ending of syntax block. Regexp block can have more than one close tag. Additional close tags can be defined inside of block as separated nodes
<Regexp open="'" close="'"> <Close text="\s"/> </Regexp>
close_lead
Reverse regular expression, which shall lead regular expression given in close tag. Use as replacement for lookabehind.
close_trail
Regular expression, which shall trail regular expression given in close tag. Use as replacement for lookahead.
start_pos
Indicates from which line column style should start (position of open tag).
first_pos
Alternative for start_pos, used if you want to specify first non white space position in the line. start_pos is absolute, and count all symbols. Can be used, for example for specifying comment style starting if found on before any non-white space character (inno_spec.xml).
escaping
The option controls, if escaping rules shall be used for the block. Make sense if EscapeChar is defined. Overwrites escaping setting of style.
Value: true or false
Default: style escaping settings
text
The attribute used, if you want to define a regular expression block that do not need close tag. In this case use attribute text instead of open tag. In this case only regular expression provided in text attribute is highlighted. The attribute can not be combined with open or close tags.
Back reference
You can use back references in regular expression block definitions, to refer previously captured groups in your current regexp.
Close Tag Back reference
There is special treatment for back references in close tags. In case, if referenced group is not found in close tag definition, it will be taken from captured groups of open tag.
Example, from Perl syntax definition:
<Regexp open="<<\s*"?([^";]+)"?.+?$" close="^\1$"/>
Open tag regular expression here then:
<<\s*"?([^";]+)"?.+?$
close tag expression:
^\1$
In the example above, close tag regular expression does not have any capture defined in, so editor will take group 1 from open tag capture.
So, if open tag matches:
<< "EOT";
than close tag will search for match of following, dynamically created, regular expression:
^EOT$