You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about FindIndex()(though I'm not sure if this project is still supported)... am I wrong, or does it call pcre_exec twice, first time via Matcher() - Reset() - Match() and then again via Match? I tried using the following replacement (Matchesinstead of Match), which seems to work, but I'm not sure if I miss something:
However, I need the offset of all groups, not only the first one, plus additional information. Plus, I don't like changing other code, so I also tried this in my own code, which seems to work as well (but again, do I miss something?):
m := patt.Matcher(payload, 0)
if m.Matches() {
grp := m.Group(0)
off := len(payload) - cap(grp)
of curse this relies on the returned slice being part of the full subject array, which again is not perfect - but there is no official access to the offsets from outside the package.
The text was updated successfully, but these errors were encountered:
I have a question about
FindIndex()
(though I'm not sure if this project is still supported)... am I wrong, or does it callpcre_exec
twice, first time viaMatcher()
-Reset()
-Match()
and then again viaMatch
? I tried using the following replacement (Matches
instead ofMatch
), which seems to work, but I'm not sure if I miss something:However, I need the offset of all groups, not only the first one, plus additional information. Plus, I don't like changing other code, so I also tried this in my own code, which seems to work as well (but again, do I miss something?):
of curse this relies on the returned slice being part of the full subject array, which again is not perfect - but there is no official access to the offsets from outside the package.
The text was updated successfully, but these errors were encountered: