replacement / substition with Haskell regex libraries

前端 未结 6 532
无人共我
无人共我 2021-02-04 01:20

Is there a high-level API for doing search-and-replace with regexes in Haskell? In particular, I\'m looking at the Text.Regex.TDFA or Text.Regex.Posix

6条回答
  •  星月不相逢
    2021-02-04 01:44

    For doing “search-and-replace” with “more advanced things with the monad, like counting occurrences, etc,” I recommend Replace.Megaparsec.streamEditT.

    See the package README for specific examples of how to count occurrences.

提交回复
热议问题