Summary
irregex-replace/all doesn't grok `bos'
Metadata
- Id: 7b79b20fd77c1a414e52276923a3138d32961454
- Trac id: 686
- Type: defect
- Reporter: syn
- Owner: sjamaan
- Cc: ashinn
- Status: closed
- Component: core libraries
- Estimated difficulty:
- Resolution: fixed
- Priority: major
- Milestone:
- Version: 4.7.x
- Changetime: 2012-12-16 15:26:07 UTC
- Created: 2011-09-06 15:56:36 UTC
- Keywords: irregex
Description
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 ".
Changes and comments
[2011-09-06 21:11:21 UTC] sjamaan set cc to foof
[2011-09-06 21:11:21 UTC] sjamaan wrote:
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.
[2011-09-06 21:12:12 UTC] sjamaan changed cc from foof to ashinn
[2011-11-04 13:44:23 UTC] felix removed milestone 4.8.0
[2012-02-21 19:03:01 UTC] sjamaan wrote:
I can't reproduce this (anymore?), not even with a clean 4.7.0; what happened?!
[2012-02-21 19:18:49 UTC] syn changed description
[2012-02-21 19:20:09 UTC] syn wrote:
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.
[2012-02-21 19:21:28 UTC] syn wrote:
(Peter's problem to reproduce the issue is fixed, not the bug itself)
[2012-11-27 21:07:43 UTC] sjamaan wrote:
We're making progress on this one. I sent a partial fix to chicken-hackers, while working out a more complete fix with Alex.
[2012-12-16 15:26:07 UTC] sjamaan changed status from new to closed
[2012-12-16 15:26:07 UTC] sjamaan set resolution to fixed
[2012-12-16 15:26:07 UTC] sjamaan wrote:
This was fixed partially by 9d905e1acd87b32b744fc308891bd968bf97f10a and then entirely by 0425b20986a049217c599870f7eed70c45cb3071