The following table describes the characters you can use for constructing regular expressions for password matching. This syntax is consistent with the regular expression syntax supported for resource matching when specifying realms.
All closure operators (+, *, ?) are greedy by default, meaning that they match as many elements of the string as possible without causing the overall match to fail. If you want a closure to be reluctant (non-greedy), follow it with a '?'. A reluctant closure matches as few elements of the string as possible when finding matches.
The regular expression syntax is a s follows:
Characters |
Results |
---|---|
\ |
Used to quote a meta-character (like '*') |
\\ |
Matches a single '\' character |
(A) |
Groups subexpressions (affects order of pattern evaluation) |
[abc] |
Simple character class (any character within brackets matches the target character) |
[a-zA-Z] |
Character class with ranges (any character range within the brackets matches the target character) |
[^abc] |
Negated character class |
. |
Matches any character other than newline |
^ |
Matches only at the beginning of a line |
$ |
Matches only at the end of a line |
A* |
Matches A 0 or more times (greedy) |
A+ |
Matches A 1 or more times (greedy) |
A? |
Matches A 1 or 0 times (greedy) |
A*? |
Matches A 0 or more times (reluctant) |
A+? |
Matches A 1 or more times (reluctant) |
A?? |
Matches A 0 or 1 times (reluctant) |
AB |
Matches A followed by B |
A|B |
Matches either A or B |
\1 |
Backreference to 1st parenthesized subexpression |
\n |
Backreference to nth parenthesized subexpression |
Limit: Each regular expression can contain no more than 10 subexpressions, including the expression itself. The number of subexpressions equals the number of left or opening parentheses in the regular expression plus one more left parenthesis for the expression itself.
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |