
ANPR LUMO
| installation guide
18/39
Regular Expressions
Regular expressions are used to conveniently define patterns for license plates or groups of license plate strings.
The ANPR LUMO uses a powerful set of regular expressions, of which the most important details are described in the
following paragraphs.
In the ANPR LUMO regular expressions, all characters match themselves (example: A is always A, B matches B etc.)
except for some special characters:
. [] {} * + ?
The single character '.' when used outside of a character set (see below) will match any single character. E.g. the
regular expression G.23456 will match G123456, or GU23456
(In the above expression, the "." is matched by 1 or U respectively)
A character range is defined by a list of characters enclosed in []. For example [A-D] will match any single character in
the range 'A' to 'D'. This character range may also be defined as [ABCD].
An atom is defined as being a character or character range.
A single atom can be repeated with the * , +, ?, and {} operators.
The * operator will match the preceding atom zero or more times, for example the expression A*B will match any of the
following: B AB AAAAAAAAAB or the expression A[BC]*D will match AD ABCD ACCCBBD
The + operator will match the preceding atom one or more times, for example the expression A+B will match any of the
following: AB AAAAAAAAB But will not match: B
The ? operator will match the preceding atom zero or one time, for example the expression CA?B will match any of the
following: CB CAB But will not match: CAAB
An atom can also be repeated with a bounded repeat, where the number of allowed repeats is defined as part of the
regular expression:
A{n} Matches 'A' repeated exactly n times.
A{n,} Matches 'A' repeated n or more times.
A{n, m} Matches 'A' repeated between n and m times inclusive.
For example:
A{2,3}
Will match either of: AA AAA But neither of: A AAAA
The following paragraphs give some examples for regular expressions and use cases:
To match any license plate strings of at least length 1:
.+
Match license plate strings which consist of digits only:
[0-9]+