sebfisch / haskell-regexp

Regular Expression Matching in Haskell
http://sebfisch.github.com/haskell-regexp/
Other
35 stars 5 forks source link

matching indices #5

Closed sebfisch closed 14 years ago

sebfisch commented 14 years ago

Instead of only indicating whether a given expression matches by returning a Bool, return a [(Index,Index)] where each pair of indices identifies a matching substring.

This can be implemented by changing the Status type. Instead of using a Bool to indicate whether an expression is final, use a [Index] to indicate where the words started that are now completely matched. In order to pass the starting index, the next function can pass it to activateFirst after the input string is zipped with [0..].

sebfisch commented 14 years ago

implemented.

see 7e56560d40b079fbdfe1b5387023423105fe61e6.

Instead of two indices, the start index and length are returned.