in reply to Re: Regex Search String in a Variable
in thread Regex Search String in a Variable

°) alas not in GnuEmacs. XEmacs had "raw strings", but became abandon-ware.

While it does not provide raw strings, I've always found the rx macro to offer a very neat solution for building complicated regular expressions, somewhat akin to Perl's /x flag:

(rx "\\x2" (one-or-more nonl) "\\x4")

Replies are listed 'Best First'.
Re^3: Regex Search String in a Variable
by LanX (Saint) on May 01, 2021 at 20:56 UTC
    that's true, but you still need two \\ to quote a meta.

    here a bad but not exceptional line taken from cperl-mode

    "\\((\\(\\\\.\\|[^\\\\()]\\|([^\\\\()]*)\\)*)\\)?"

    edit

    and more things need escaping in elisp regexes

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery