From 3522966d9584ec16e2f469acd0fe8727857a9d25 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 29 Jun 2026 00:15:46 +0200 Subject: implemented the ^~ pattern match construct: the rest of the pattern will be an Advanced Regular Expression * Allows searching by regular expressions. We will never support all ARE constructs in TECO patterns, so this is useful to have available. * Can only be typed upcaret. This leaves ^E~q available as an escape-regexp string building construct. * Once we replace the pattern2regexp converter with a custom terex lexer, we might want to restrict ^~ to the beginning of the pattern. Currently, however it can be anywhere, so you can mix TECO patterns with regular expressions. --- tests/testsuite.at | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/testsuite.at b/tests/testsuite.at index 0f7e32b..95c1336 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -293,6 +293,10 @@ TE_CHECK([[@I/XYZ/J @EB/foo/ @I/XZY/J @:FN/Z/0/"F(0/0)' Q*-2"N(0/0)' @:FN///"F(0/0)' Q*-1"N(0/0)']], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Searches by regexp]) +TE_CHECK([[@I/ABC/J :@S/^~[A-Z]+/"F(0/0)']], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Search and insertion ranges]) # When deleting characters, the result of ^S/^Y must not change. TE_CHECK([[@I/XXYYZZ/^SC ."N(0/0)' C @S/YY/ HK ^YU1U0 Q0-2"N(0/0)' Q1-4"N(0/0)']], 0, ignore, ignore) -- cgit v1.2.3