QuoteMeta Behavior  ( the \Q .. \E construct )



Quotemeta is unusual in that it is a host language pre-processor dependency.

Specifically this has to do with Perl.

However, this construct can be presented to Regular Expression engines.

That is a problem for host languages that are not Perl, like PCRE for instance.


PCRE will recognize the \Q .. \E construct, but it does not really want to

do pre-processing on it.


To accommodate this behavior, RegexFormat offers the option

to recognize this construct and even resolve its content into its escaped

literal character form.


This option is be automatically enabled/disabled from the Flags Pane based

on the preset Language selected and what that Language has the ability to do.

As always, all options are customizable.


Allow Quotemetta Processing

This is the flag that turns \Q .. \E processing on or off.

When turned on, two other flags become available.


1.     Recognize quotemeta construct in classes

This option will do \Q .. \E parsing in the class but it will not escape/resolve

its content. Internally, the option to escape quotemeta content  in classes

is available, but it was decided not to make it selectable because of some

possible conflicts.


2.     Escape quotemeta content

This option will resolve any level of  \Q .. \E nesting to its literal form only

if the construct is OUTSIDE of a class.


In general, caution should be used when enabling this construct.

The \Q will start a recursive nesting algorithm looking for its mating \E.

If not found, every character to the end of file will be considered

quotemeta and not regular expression. This could lead to unexpected

errors popping up.


Finally, PCRE and Perl are the only flavors for which quotemeta processing

are available, but again (as always), all options are customizable.



RegexFormat Help - 2014 RDNC Software