开发者

How can I do regex search and replace using Haskell's text-icu package?

The Hackage page [1] for this package says "Features include ... Regular expression search and replace" but I can't seem to find any functions that do this. I looked in the top-level module page [2] an开发者_开发百科d also the Data.Text.ICU.Regex page but found nothing.

[1] http://hackage.haskell.org/package/text-icu

[2] http://hackage.haskell.org/packages/archive/text-icu/0.6.3.4/doc/html/Data-Text-ICU.html


It looks like you would have to construct a text replacement function yourself from the start and end functions in Data.Text.ICU.Regex. Note that the Regex object is stateful, and you have to attach text to it and then perform a search before asking for the bounds. It's not idiomatic Haskell, that's for sure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜