Open
Description
Here is an example that doesn't works when importing Text.RE.PCRE.String
.
I want to add commas ,
into a string of digits, separating it every three digits from right to left. The code snippet is as follows:
ghci> "12345678" *=~/ [ed|(?<=\d)(?=(\d\d\d)+$)///,|]
"12,345678"
ghci> "12345678" ?=~/ [ed|(?<=\d)(?=(\d\d\d)+$)///,|]
"12,345678"
Here (*=~/)
works the same as (?=~/)
. For the multiple replacement, it should be "12,345,678"
.
More examples:
ghci> "1a2a3a" *=~/ [ed|(?=a)///,|]
"1,a2a3a"
ghci> "1a2a3a" *=~/ [ed|(?<=a)///,|]
"1a,2a3a"
This may be a bug. Please check it. Thanks!