Skip to content

Commit 95c2e2a

Browse files
committed
match function
1 parent 495d090 commit 95c2e2a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pixie/regex.pxi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,15 @@
6868
:signatures [[rexegp-str opts]]}
6969
[regexp-str opts]
7070
(cre2_new regexp-str (count regexp-str) (cre2-opts opts)))
71+
72+
(defn match
73+
[pattern text]
74+
(cre2_match
75+
pattern
76+
text
77+
(count text)
78+
0
79+
(count text)
80+
1 ;; anchor 1 - no, 2 - start, 3 - both
81+
(cre2_string_t)
82+
(+ 1 (cre2_num_capturing_groups pattern))))

0 commit comments

Comments
 (0)