summaryrefslogtreecommitdiffstats
path: root/modules/regex.inc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/regex.inc')
-rw-r--r--modules/regex.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/regex.inc b/modules/regex.inc
index 21c3d65..3188b2d 100644
--- a/modules/regex.inc
+++ b/modules/regex.inc
@@ -1,5 +1,10 @@
#!/bin/ash
+# Match $1 against perl regex $2, case sensitive
+regex_match() {
+ printf "%s" "$1" | grep -qP "$2"
+}
+
# Match $1 against perl regex $2, case insensitive
regex_imatch() {
printf "%s" "$1" | grep -qPi "$2"