re_match()#

Purpose#

re_match(expr, re)

Returns 1, if expr matches re, 0 otherwise. Uses POSIX ERE. In contrast to re_match_i() the matching is case-sensitive.

Note

Functions using regular expressions tend to be slow and other options may be faster.

Example#

In the following example it is checked if the msg object matches the regex string.

re_match($msg,'(5[1-5][0-9]{14})')

Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2026 Rainer Gerhards and others. Licensed under the Apache License 2.0.