From 6acbd326f392a9a3a366947f6f9a05c7bdf7bc52 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 17 Dec 2023 14:56:49 +0000 Subject: Add the regex_stdlib regular expression engine. Unlike other regular expression engines this is available on all systems. --- data/anope.example.conf | 2 +- data/modules.example.conf | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/anope.example.conf b/data/anope.example.conf index 118f2f2f5..62eaa8154 100644 --- a/data/anope.example.conf +++ b/data/anope.example.conf @@ -527,7 +527,7 @@ options * * Note for this to work the regex module providing the regex engine must be loaded. */ - #regexengine = "regex/pcre" + #regexengine = "regex/stdlib" /* * A list of languages to load on startup that will be available in /NICKSERV SET LANGUAGE. diff --git a/data/modules.example.conf b/data/modules.example.conf index 6630bc750..fdf5b57be 100644 --- a/data/modules.example.conf +++ b/data/modules.example.conf @@ -412,10 +412,32 @@ module { name = "help" } * m_regex_posix [EXTRA] * * Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions. - * This is likely the only regex module you will not need extra libraries for. */ #module { name = "m_regex_posix" } +/* + * m_regex_stdlib + * + * Provides the regex engine regex/stdlib, which uses the regular expression library that is part of + * the C++ standard library. +*/ +module +{ + name = "m_regex_stdlib" + + /* + * The syntax scheme to use. Can be set to awk to use the regular expression grammar used by the + * awk utility in POSIX, basic to use the basic POSIX regular expression grammar, ecmascript to + * use the modified ECMAScript regular expression grammar, egrep to use the regular expression + * grammar used by the grep utility with the -E option in POSIX, extended to use the extended + * POSIX regular expression grammar, or grep to use the regular expression grammar used by the + * grep utility in POSIX. + * + * See https://en.cppreference.com/w/cpp/regex/syntax_option_type for more information. + */ + syntax = "ecmascript" +} + /* * m_regex_tre [EXTRA] * -- cgit