aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-29 19:14:03 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-29 19:14:03 +0200
commitd71d7527a8be8654560867d761036598408bfe14 (patch)
tree57a3f056e8b1039b172a618aec264e8c172d4925 /README.md
parent7c103ba4914cb47cb1e6c51cc9b8121aa5e6ef62 (diff)
downloadterex-d71d7527a8be8654560867d761036598408bfe14.tar.gz
implemented tere_set_is_interrupted_cb()
Allows you to set up a callback that's invoked repeatedly during matching. If it returns non-0 matching will abort and REG_EINTR is returned. Allows you to interrupt long-running regexp executions that would otherwise block the UI or hang the entire application.
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 3 insertions, 5 deletions
diff --git a/README.md b/README.md
index c35480e..6dbfbca 100644
--- a/README.md
+++ b/README.md
@@ -23,14 +23,12 @@ Compared to hsrex, this library has the following changes:
`tere_comp()` compilation flag.
* Support the `REG_ANCHORED` flag for `tere_exec()`.
* `tere_free()` ignores nullified `regex_t` objects.
+* `tere_set_is_interrupted_cb()` allows configuring a repeatedly
+ invoked callback. If it returns true (non-null) matching aborts
+ immediately and `tere_exec()` will return `REG_EINTR`.
## TODO
-* Hook into the matching algorithm.
- Even though runtime cannot be as catastrophically bad as in pure
- backtracking engines like PCRE, `tere_exec()` calls can still be slow
- on extremely large texts.
- The hook allows interruptions.
* Expose enough API to swap out the regular expression lexer.
Useful for custom DSLs like glob patterns or TECO patterns.
* Support splitting the subject string into two halves, so we can