From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Cc: Emacs help <help-gnu-emacs@gnu.org>
Subject: Re: Question about string-match and match-string
Date: Wed, 17 Jul 2013 12:02:47 +0200 [thread overview]
Message-ID: <20130717100247.GA22656@kuru.dyndns-at-home.com> (raw)
In-Reply-To: <877ggpzhxh.fsf@yahoo.fr>
Hi Nicolas,
On Wed, Jul 17, 2013 at 10:53:14AM +0200, Nicolas Richard wrote:
>
> > PS: I'm also not very clear why we need 4 \-s in the regex to match a
> > single \ in the string. I came up with it by trial and error with the
> > regexp-builder. Any explanation about that would also be great.
>
> I hope the above is an explanation of that. Just remember there are two
> steps:
> (i) emacs reads the string
> (ii) the string is made into a regexp
> so for matching on \, you need the regexp \\, which is obtained by the
> string "\\\\" (e.g. (insert "\\\\") inserts \\)
Thank you for the very clear explanation. It was very helpful. :)
Cheers,
--
Suvayu
Open source is the future. It sets us free.
prev parent reply other threads:[~2013-07-17 10:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 8:17 Question about string-match and match-string Suvayu Ali
2013-07-17 8:35 ` Suvayu Ali
2013-07-17 8:44 ` Rasmus
2013-07-17 8:55 ` Suvayu Ali
2013-07-18 8:00 ` Julien Cubizolles
2013-07-18 8:33 ` Rasmus
2013-07-20 15:26 ` Julien Cubizolles
2013-07-20 22:25 ` Rasmus
2013-07-21 0:41 ` Rasmus
2013-07-21 8:15 ` Julien Cubizolles
2013-07-17 8:53 ` Nicolas Richard
2013-07-17 10:02 ` Suvayu Ali [this message]
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=20130717100247.GA22656@kuru.dyndns-at-home.com \
--to=fatkasuvayu+linux@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=theonewiththeevillook@yahoo.fr \
/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).