summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-30 05:28:00 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-30 05:28:00 +0100
commita8944b93e707a8f3ba9fde0ba530ee8f4427f950 (patch)
treeaa003c814bad996c9456b68b77ffcf756bfa2c68 /src
parent960972865c0722a9f769d642e4ef36769439c444 (diff)
conf: use [0-9] instead of [[:digit:]] for shorter re strings
Diffstat (limited to 'src')
-rw-r--r--src/conf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/conf.c b/src/conf.c
index f2b8c31..6deaa10 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -49,21 +49,22 @@
* can (and likely should) be used when building the regex for the
* given directive.
*/
+#define DIGIT "[0-9]"
#define WS "[[:space:]]+"
#define STR "\"([^\"]+)\""
#define BOOL "(yes|on|no|off)"
-#define INT "(()[[:digit:]]+)"
+#define INT "(()" DIGIT "+)"
#define ALNUM "([-a-z0-9._]+)"
#define USERNAME "([^:]*)"
#define PASSWORD "([^@]*)"
#define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})"
-#define IPMASK "(" IP "(/[[:digit:]]+)?)"
+#define IPMASK "(" IP "(/" DIGIT "+)?)"
#define IPV6 "(" \
"(([0-9a-f:]{2,39}))|" \
"(([0-9a-f:]{0,29}:" IP "))" \
")"
-#define IPV6MASK "(" IPV6 "(/[[:digit:]]+)?)"
+#define IPV6MASK "(" IPV6 "(/" DIGIT "+)?)"
#define BEGIN "^[[:space:]]*"
#define END "[[:space:]]*$"