[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regular expression grouping not working?
From: |
Douglas Lewan |
Subject: |
Re: Regular expression grouping not working? |
Date: |
Sat, 8 Feb 2020 14:48:26 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 2/8/20 2:30 PM, Teemu Likonen wrote:
Douglas Lewan [2020-02-08T14:17:54-05] wrote:
I'm writing some code that includes the regular expression \\([^/]+/\\),
(looking for a path on GNU/Linux) which doesn't match what I expect it
should.
Maybe your backslash escaping is wrong. In regular expressions the
grouping is made with \( \) but within Lisp strings backslash has a
special meaning too and those must be escaped "\\( \\)".
Damn! I was passing the double slash to a command I use to help me debug
regular expressions.
Hand it the right string and it matches just as expected. (Too much
kill-and-yank.)
Maybe now I can track down the real bug.
Thanks for helping me change my perspective.
Is there something I'm missing?
I think we need more information about your code and input data.
--
,Doug
d.lewan2000@gmail.com
(908) 720 7908
Isn't there a difference between "acquittal" and "exoneration"?