in with
Tutorial

KorAP: Regular Expressions

Regular expressions are patterns describing a set of strings.

In the KorAP backend a wide range of operators is supported, but only the following are guaranteed to be stable throughout the system:

Operators

. - Any
Any symbol
() - Group
Create a group of operands
| - Alternation
Create alternative operands
[] - Character Class
Group alternative characters
\ - Escape symbol
Mark the following character to be interpreted as verbatim, when the character is special (i.e. an operator or quantifier)
".eine" Frau
"Fr..de"
"Fr(ie|eu)de" []{,3} Eierkuchen
"Fre[um]de"
"b.w\."

Quantifiers

Operands in regular expressions can be quantified, meaning they are allowed to occur consecutively a specified number of times. The following quantifieres are supported:

?
Match 0 or 1 times
*
Match 0 or more times
+
Match 1 or more times
{n}
Match n times
{n,}
Match at least n times
{n,m}
Match at least n times but no more than m times
"Schif+ahrt"
"kl?eine" Kinder
"Schlos{2,3}traße"
"Rha(bar){2}"