Opened 14 years ago

Last modified 13 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 Moritz Heidkamp)

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 by sjamaan, 14 years ago

Cc: foof added

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.

comment:2 by sjamaan, 14 years ago

Cc: Alex Shinn added; foof removed

comment:3 by felix winkelmann, 14 years ago

Milestone: 4.8.0

comment:4 by sjamaan, 14 years ago

I can't reproduce this (anymore?), not even with a clean 4.7.0; what happened?!

comment:5 by Moritz Heidkamp, 14 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.