str: Support new prefix-matching feature in str_match.
[mLib-python] / str.pyx
diff --git a/str.pyx b/str.pyx
index 7ec1ed4..b7d80e6 100644 (file)
--- a/str.pyx
+++ b/str.pyx
@@ -76,8 +76,11 @@ def split(char *p, int n = -1, quotep = False):
   xfree(op)
   return l, r
 
-def match(char *p, char *s):
-  return _tobool(str_match(p, s))
+def match(char *p, char *s, prefixp = False):
+  cdef unsigned f
+  if prefixp:
+    f = f | STRF_PREFIX
+  return _tobool(str_matchx(p, s, f))
 
 def sanitize(char *p, int n = -1):
   cdef char *buf