sebfisch / haskell-regexp

Regular Expression Matching in Haskell

Home Page:http://sebfisch.github.com/haskell-regexp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

matching indices

sebfisch opened this issue · comments

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..].

implemented.

see 7e56560.

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