RE2 Syntax

In Texis version 7.06 and later, on most platforms the search expression may be given in RE2 syntax instead of REX. RE2 is a Perl-compatible regular expression library whose syntax may be more familiar to Unix users than Texis' REX syntax. An RE2 expression in REX is indicated by prefixing the expression with "\<re2\>". E.g. "\<re2\>\w+" would search for one or more word characters, as "\w" means word character in RE2, but not REX.

REX syntax can also be indicated in an expression by prefixing it with "\<rex\>". Since the default syntax is already REX, this flag is not normally needed; it is primarily useful in circumstances where the syntax has already been changed to RE2, but outside of the expression - e.g. a Vortex <rex> statement with the option syntax=re2.

Note that while the \<re2\> and \<rex\> escapes are supported on all platforms, an RE2 expression itself may not be. Where unsupported, attempting to invoke an RE2 expression will result in the error message "REX: RE2 not supported on this platform". Use <vxinfo features> (here) or the SQL function hasFeature() to determine if the current texis -platform platform supports RE2 expressions. (Windows, Linux 2.6 and later versions except i686-unknown-linux2.6.17-64-32 are supported.)

RE2 syntax is documented at https://github.com/google/re2/wiki/Syntax.


Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.