[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [External] : Use the characters "+" and "-" in regular expressions
From: |
tomas |
Subject: |
Re: [External] : Use the characters "+" and "-" in regular expressions |
Date: |
Thu, 20 May 2021 13:59:05 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, May 20, 2021 at 01:31:22PM +0200, Christopher Dimech wrote:
> This could be what you need
>
> (string-match "[\s]+ " s)
You know that you can say " " instead of "\s", right? This is because,
in string literal syntax, "\s" is special and replaced by a space
(analog to "\n", "\r" and friends). This has nothing to do with
regexps: the regexp engine gets to see the " ".
So it's the same as "[ ]+ ".
This is a row of one or more spaces, followed by a space -- which is
the same as a row of two or more spaces, which can be also written
" \\{2\\}" (remember: one backslash for the Lisp string, one for the
regexp).
Cheers
- t
signature.asc
Description: Digital signature
- Re: [External] : Use the characters "+" and "-" in regular expressions, (continued)
- Re: [External] : Use the characters "+" and "-" in regular expressions, tomas, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, tomas, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, tomas, 2021/05/20
- [External] : Use the characters "+" and "-" in regular expressions, Christopher Dimech, 2021/05/20
- [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- [External] : Use the characters "+" and "-" in regular expressions, Christopher Dimech, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, Jean Louis, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions,
tomas <=
- Re: [External] : Use the characters "+" and "-" in regular expressions, Jean Louis, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, Jean Louis, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, Jean Louis, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, Yuri Khan, 2021/05/20
- [External] : Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, Eduardo Ochs, 2021/05/20
- RE: [External] : Use the characters "+" and "-" in regular expressions, Drew Adams, 2021/05/20
- Re: [External] : Use the characters "+" and "-" in regular expressions, Jean Louis, 2021/05/21