|
From: | Joost Kremers |
Subject: | Re: Regular expressions and user-escaped characters |
Date: | Tue, 03 Dec 2024 00:09:01 +0100 |
User-agent: | AquaMail/1.53.0 (build: 105300523) |
On 2 December 2024 23:51:49 Joost Kremers <joostkremers@fastmail.fm> wrote:
On Mon, Dec 02 2024, Joost Kremers wrote:You may get away with something like "[^\\][[]", though keep in mind that that does not match a ?[ not preceded by a backslash, but rather a ?[ preceded by a character that is not a backslash.Mind you, what I forgot to mention: this means that a ?[ at the start of a string won't be found. A possible solution to that might be to prepend some character to the string before matching.
Or, try usimg \\| to match either a ?[ at the start ot the string or a ?[ preceded by a character other than a backslash...
\\(?:^[[]\\|[^\\][[]\\) Whew...
-- Joost Kremers Life has its moments
[Prev in Thread] | Current Thread | [Next in Thread] |