Opened 14 years ago
Last modified 12 years ago
#686 closed defect
irregex-replace/all doesn't grok `bos' — at Version 5
Reported by: | Moritz Heidkamp | Owned by: | sjamaan |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | core libraries | Version: | 4.7.x |
Keywords: | irregex | Cc: | Alex Shinn |
Estimated difficulty: |
Description (last modified by )
When irregex-replace/all
is given a pattern containing a bos
anchor it will not behave as expected. For example this call:
(irregex-replace/all '(seq bos #\space) " x " "*")
returns "***x "
rather than the expected "* x "
.
Change History (5)
comment:1 Changed 14 years ago by
Cc: | foof added |
---|
comment:2 Changed 14 years ago by
Cc: | Alex Shinn added; foof removed |
---|
comment:3 Changed 14 years ago by
Milestone: | 4.8.0 |
---|
comment:4 Changed 13 years ago by
I can't reproduce this (anymore?), not even with a clean 4.7.0; what happened?!
comment:5 Changed 13 years ago by
Description: | modified (diff) |
---|
Note: See
TracTickets for help on using
tickets.
The problem is that it uses irregex-fold which walks the string; it starts at the given starting point, matches and then starts again with the new starting point in the string being the place where the previous match ended.
The problem is basically that the beginning of string should only match when the substring starts at wherever you initially started to match. I'm not sure if/how this can be solved easily.