haskell-hvr / regex-tdfa

Pure Haskell Tagged DFA Backend for "Text.Regex" (regex-base)
http://hackage.haskell.org/package/regex-tdfa
Other
38 stars 10 forks source link

`getAllTextMatches` only delivers matches "on-the-money" #15

Closed eppolito closed 3 years ago

eppolito commented 3 years ago

Matching a string of repeated characters seems to confuse getAllTextMatches. Minimal test case:

Input: > getAllTextMatches ("aaa" =~ "aa") :: [String] Output: ["aa"] Expected ["aa","aa"]

Input: > getAllTextMatches ("aaaa" =~ "aa") :: [String] Output: ["aa","aa"] Expected ["aa","aa","aa"]

I guess getAllTextMatches is removing the match before looking for additional matches.

andreasabel commented 3 years ago

This behavior conforms to what Text.Regex.Posix and Text.Regex.PCRE are doing, so I am inclined to consider this working as intended. PR #25 documents this.

eppolito commented 3 years ago

Thanks for addressing this! Still seems slightly weird to me, but if this is the convention best to go with it.