[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use the characters "+" and "-" in regular expressions
From: |
steve-humphreys |
Subject: |
Re: Use the characters "+" and "-" in regular expressions |
Date: |
Wed, 19 May 2021 18:26:29 +0200 |
I want to match a space followed by a series of "+" or "-" or "."
Sent: Thursday, May 20, 2021 at 4:17 AM
From: "Skip Montanaro" <skip.montanaro@gmail.com>
To: steve-humphreys@gmx.com
Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
Subject: Re: Use the characters "+" and "-" in regular expressions
Is there a way to use the character "+" and "-" in regular
expressions?
Yes, use character sets, e.g. [+] and [-]. If more characters are in a
set along with a hyphen, that hyphen needs to be the first element of
the set so as not to be interpreted as defining a range of characters.
So, the character set containing 0, 9 and hyphen is [-09] or [-90], not
[0-9], which would include all digits between 0 and 9, but not the
hyphen.
Skip
- Use the characters "+" and "-" in regular expressions, steve-humphreys, 2021/05/19
- Re: Use the characters "+" and "-" in regular expressions, Skip Montanaro, 2021/05/19
- Re: Use the characters "+" and "-" in regular expressions,
steve-humphreys <=
- Re: Use the characters "+" and "-" in regular expressions, Yuri Khan, 2021/05/19
- Re: Use the characters "+" and "-" in regular expressions, tomas, 2021/05/19
- RE: [External] : Re: Use the characters "+" and "-" in regular expressions, Drew Adams, 2021/05/19
- Re: 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