A coworker shared the following while researching the use of regex in our agent.
The BES Client uses the boost C++ libraries in the agent:
So the way relevance regex works is consistent across our agents. This may, however, differ from how regex works in the various shell script contexts.
There are three major families of regex:
-
"Classic" regex (which peter is following)
-
POSIX regex, above with extensions like "+" and "{min,max}"
-
Perl regex, mostly compatible with both of the above. Perl adds a lot of special character class shortcuts and assertions like \w\W and \s\S and \b\B. The latter, which matches a "word boundary" and doesn't actually match a character is particularly useful, but more or less available only in perl.
His understanding is that Boost is mostly "2". Often in SCM because we have to assume only native shell and tools, you are often forced on non-Linux OSes back to family "1".
The wikipedia article is a decent intro to the subject:
http://en.wikipedia.org/wiki/Regular_expression
If you stick to the lowest level, your regex should work everywhere.
I found this extremely helpful and wanted to share this tidbit of information.