Products | Versions |
---|---|
Spotfire Statistica | 10 and later versions |
char | meaning |
---|---|
^ | beginning of string |
$ | end of string |
. | any character except newline |
* | match 0 or more times |
+ | match 1 or more times |
? | match 0 or 1 times; or: shortest match |
| | alternative |
( ) | grouping; “storing” |
[ ] | set of characters |
{ } | repetition modifier |
\ | quote or special |
a* | zero or more a’s |
a+ | one or more a’s |
a? | zero or one a’s (i.e., optional a) |
a{ m} | exactly m a’s |
a{ m,} | at least m a’s |
a{ m, n} | at least m but at most n a’s |
expression | matches... |
---|---|
abc | abc (that exact character sequence, but anywhere in the string) |
^abc | abc at the beginning of the string |
abc$ | abc at the end of the string |
a|b | either of a and b |
^abc|abc$ | the string abc at the beginning or at the end of the string |
ab{2,4}c | an a followed by two, three or four b ’s followed by a c |
ab{2,}c | an a followed by at least two b ’s followed by a c |
ab*c | an a followed by any number (zero or more) of b ’s followed by a c |
ab+c | an a followed by one or more b ’s followed by a c |
ab?c | an a followed by an optional b followed by a c ; that is, either abc or ac |
a.c | an a followed by any single character (not newline) followed by a c |
a\.c | a.c exactly |
[abc] | any one of a , b and c |
[Aa]bc | either of Abc and abc |
[abc]+ | any (nonempty) string of a ’s, b ’s and c’s (such as a , abba , acbabcacaa ) |
[^abc]+ | any (nonempty) string which does not contain any of a , b and c (such as defg ) |
\d\d | any two decimal digits, such as 42 ; same as \d{2} |
The following options are available for RE_SEARCH, RE_MATCH, and RE_REPLACE:
b: Use POSIX basic grammar rather than PERL-like grammar. Similar to sed and grep.
x: Use POSIX extended grammar (similar to egrep).
Note : b and x are mutually exclusive; x overrides b.
i: Ignore case.
e: Allow the pattern to match an empty string.
s: Allow '.' to match newlines (similar to PERL's /s).
m: Allow the use of ^, $ as anchors to match start and end of a line, respectively (similar to PERL's /m).
g: Replace globally (similar to PERL's /g). In a RE_REPLACE, replaces all matches not just the first.
c: In a RE_REPLACE, do not copy to the output string portions of the input that did not match the regular expression.