Opened 14 years ago
Closed 13 years ago
#686 closed defect (fixed)
irregex-replace/all doesn't grok `bos'
| 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 (9)
comment:1 by , 14 years ago
| Cc: | added |
|---|
comment:2 by , 14 years ago
| Cc: | added; removed |
|---|
comment:3 by , 14 years ago
| Milestone: | 4.8.0 |
|---|
comment:4 by , 14 years ago
I can't reproduce this (anymore?), not even with a clean 4.7.0; what happened?!
comment:5 by , 14 years ago
| Description: | modified (diff) |
|---|
comment:6 by , 14 years ago
I think this was caused by a markup fail in the ticket: the code wasn't marked up properly leading to the (in this case important) whitespace getting folded. Fixed now.
comment:8 by , 13 years ago
We're making progress on this one. I sent a partial fix to chicken-hackers, while working out a more complete fix with Alex.
comment:9 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
This was fixed partially by 9d905e1acd87b32b744fc308891bd968bf97f10a and then entirely by 0425b20986a049217c599870f7eed70c45cb3071

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.