From: Joost Kremers <joostkremers@fastmail.fm>
To: Christopher Howard <christopher@librehacker.com>
Cc: Help Gnu Emacs Mailing List <help-gnu-emacs@gnu.org>
Subject: Re: Regular expressions and user-escaped characters
Date: Tue, 03 Dec 2024 00:09:01 +0100 [thread overview]
Message-ID: <19389a262c8.27ee.f7cab59eedd5157033ccb454e473dbca@fastmail.fm> (raw)
In-Reply-To: <86mshdwvgg.fsf@fastmail.fm>
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
next prev parent reply other threads:[~2024-12-02 23:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 22:04 Regular expressions and user-escaped characters Christopher Howard
2024-12-02 22:32 ` Joost Kremers
2024-12-02 22:50 ` Joost Kremers
2024-12-02 23:09 ` Joost Kremers [this message]
2024-12-03 14:01 ` Stefan Monnier via Users list for the GNU Emacs text editor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19389a262c8.27ee.f7cab59eedd5157033ccb454e473dbca@fastmail.fm \
--to=joostkremers@fastmail.fm \
--cc=christopher@librehacker.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).