Regular Expressions
Regular expressions provide a way to identify patterns of text in strings.
Bravura Security Fabric uses regular expressions to:
Match and block invalid passwords.
Identify users who it should not manage.
Extract text from Telnet/TN3270 screens in Telnet connector scripts.
Extract text from the output of password hashing programs in DBMS connector scripts.
Regular expressions use a shorthand of literal characters and special characters to define a pattern in a precise and compact way. Literal characters are case-sensitive. The regular expression parser used by Bravura Security Fabric uses the following special characters in literal strings:
Character | Purpose | Example | Match |
---|---|---|---|
. | Matches any single character | a.c | aac , abc , a1c , a2c |
^ | Beginning of a line | ^hat | hat , hatch , not chat |
$ | End of a line | hat$ | hat , chat , not hatch |
| | Alternation | job | task | job or task |
( ) | Grouping | job(12 | 34) | job12 or job34 |
\ | Treat the following special character literally | \$5\.6\\7 | $5.6\7 |
The |
alternates the longest possible string. That is, it matches job
or task
, and matches both jotask
and jobask
.
Grouping with ( )
limits the alternate branches.