[fpc-pascal] Last fix for RegExpr (error on empty input)
Michael Van Canneyt
michael at freepascal.org
Sat Feb 15 16:31:45 CET 2020
On Sat, 15 Feb 2020, AlexeyT via fpc-pascal wrote:
> My app does mass replace with regex. in big text, user enters regex "\b"
> and replaces it to eg "__". app calls Substitute() with each found
> match, match is zero length so your code will NOT replace it to "__".
> but it's needed to replace it to "__".
That can well be, but maybe in that case you need to change your app for
this particular use case. It's very much a corner case.
The alternative is to introduce a new boolean option for TRegexp which
controls the behaviour of substitute.
Since there are already 9 boolean properties, it may be better to introduce a Options
set property and mark the others deprecated.
More information about the fpc-pascal