Regular Expression
RegularExpressions are a special kind of text search commands. They are used in many places in ProWiki and - because ProWiki is written in Perl - the RegularExpressions are used in the Perl flavour.
| special commands | meaning | matches | doesn't match |
. | any character | almost everything | end of line "\n" |
A* | zero, one or more A | "", "A" or "AAAA" | "B", almost everything else |
.* | something in between | "asghas" | matches everything |
A.*B | A and B and something in between | "Alligator Berni" or "AB" | "AC" |
x+ | one or more "x" | "x", "xx" or "xxxx" | "" or "alpha" |
\d | a digit | "1" or "6" | "xyz" |
\s | whitespace | " " or "\t" | "abc" |
[ABD] | one of the characters between brackets | "A", "B" or "D" | "C" |
[a-z]+ | one or more lower case characters | "alpha" or "butter" | "ALPHA" |
(alpha|beta|gamma) | one of the words "alpha", "beta" or "gamma" | "alpha" | "berta" |
^ | beginning of line | | |
^A | | a line starting with "A" | a line starting with any other character |
$ | end of line | | |
)$ | | right parenthesis at the end of line | any other character at the end of line |
^.{10}$ | | a line exactly 10 characters long | any other line length |
|
|
RegularExpressions can become arbitrarily complex. There are tutorials and books on this topic. This is just to give you a taste of it.
FolderGlossary
|