Regex: need a "find" progress callback to interrupt/cancel long-running searches

Description

When a find operation takes a long time, not because of the complexity of the expression, but because of the length of the string being searched, it would be valuable to have a callback.
Currently ICU regex has a "match" callback that can be set to be called periodically during the evaluation of a complex expression, to give the client the opportunity to cancel e.g. if backtracking takes exponential time.
It would be useful to have a second callback, what we might call a "progress" callback, that would be called as the internal position of the matcher advances.

<From Andy>
The find() function would get along well with your proposal, however. The match engine proper is really determining whether the pattern matches the string at a specific starting position. find(), on the other hand, is searching for matches, has its own loop for that search, and does move consistently forward

<From Michael Grady>
We have the "find progress" callback hooked up and working. It works especially well in the failure case because MatchAt() reports back to find() which then repeatedly advances the index and retries.

Activity

Show:
TracBot
June 30, 2018, 11:59 PM
Trac Comment 6 by —2010-05-05T19:02:52.000Z

Need proposal to icu-design

TracBot
June 30, 2018, 11:59 PM
Trac Comment 9 by anonymous—2010-06-07T14:53:18.000Z

Proposal sent out to icu-design 6/6/10 "Proposal: Regex "find progress" callback for 4.5.1"

TracBot
June 30, 2018, 11:59 PM
Trac Comment 10 by mishonok—2010-06-08T17:19:00.000Z

Branched sources in branches/mishonok/regex-callback

TracBot
June 30, 2018, 11:59 PM
Trac Comment 12 by mishonok—2010-06-15T20:21:59.000Z

Merged changes from branch to trunk

TracBot
June 30, 2018, 11:59 PM
Trac Comment 13 by —2016-10-05T23:14:06.988Z

Milestone 4.5.1 deleted

Fixed

Assignee

TracBot

Reporter

TracBot

Components

Labels

None

Reviewer

None

Priority

medium

Time Needed

None

Fix versions