Regular expressions
You can use regular expressions to filter data, such as specific objects whose attributes or properties match a regular expression (text pattern).
You can link/combine the regular expressions with normal text, e.g. "Employee: M[ae][iy]er".
Syntax rules:
The following table shows the most important syntax rules for regular expressions:
Syntax for regular expression (text pattern) | Description | Example |
---|---|---|
[ ... ] | String (different characters or range) in square brackets | BPMN diagram [1-9] = e.g. "BPMN diagram 1", "BPMN diagram 2" |
. (dot) | any character (except \n) | .nd = e.g. end, and, bend, etc. |
\s | whitespace | forward\s[A-Za-z]* = e.g. "forward invoice", "forward letter". |
() | A partial expression is enclosed in round brackets | (Freehand|BPMN) diagram = Freehand diagram or BPMN diagram |
| (pipe character) | Logical or-connection of partial expressions | (M|N)(A|E)=MA,ME,NA or NE |
No indication of frequency | Frequency of a specified character = 1 | [1-9] = a single digit e.g. 7 |
+ after a string | of a specified character exists at least once | [A-Za-z]+ = e.g. M, employee, role, organizational unit |
* after a string | of a specified character 0...n | [A-Za-z]* = e.g. " ", "Leg.Ent" (when comparing with a short name) |
{<min>,<max>} after a string | of a specified character repetitions minimum and maximum value e.g. {2,4}=2 to 4 times, {2, } =at least 2 times, {,5}=maximum 5 times, {6}=exactly 6 times : | Employee number:\s1[0]{1,3}[0-9]* i.e. employee number starts with 10, 100, or 1000 e.g. 100055678 |
? after a string | of a specified character exactly once or not at all | [1-9]*[/]?[1-9]* = e.g. 0711/467832 or 0711467832 when comparing a telephone number |
^(caret character) inside square brackets before a string | Character or set of characters that must not be included | [^A-Za-z], i.e. no alphabetical character |
\p{ASCII} | all ASCII characters are possible: ␣!"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ [\]^_` abcdefghijklmnopqrstuvwxyz {|}~ |
More examples of regular expressions:
Regular expression | Examples of matching expressions (match) |
---|---|
[A-Za-z1-9]* | All lowercase and uppercase letters as well as all digits may occur 0 to n times |
[^1-9]+ | At least one character except digits |
M[ea][iy]er | All spellings of the surname "Meier |
send\s[A-Za-z1-9]* | Send invoice, send letter |
[A-Za-z1-9]*process[\pASCII}]* | e.g. sales process, sales processes, Process, process, marketing process1, process_1, |
[\p{ASCII}]*[Dd]iagram[\p{ASCII}]* | Freehand diagram, BPMN diagram, Diagram, diagram |