[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: Use the characters "+" and "-" in regular expressio
From: |
Drew Adams |
Subject: |
RE: [External] : Re: Use the characters "+" and "-" in regular expressions |
Date: |
Wed, 19 May 2021 21:59:11 +0000 |
> Hm. According to the docs, the dash should go last, but
> a test actually confirms that it works in first position.
I quoted this from (elisp) `Regexp Special':
To include a ‘-’, write ‘-’ as the first or last
^^^^^^^^^^^^^
character of the character alternative, or as the
upper bound of a range. Thus, ‘[]-]’ matches both
‘]’ and ‘-’.
That's from Emacs 26 (and all prior releases, at least
as far back as Emacs 20). But yes, they changed that
text for Emacs 27, to this:
To include ‘-’, put it at the end.
^^^^^^^^^^
___
For Emacs 20, it says this:
To include a `-', write `-' as the first or last
character of the character alternative, or put it
after a range. Thus, `[]-]' matches both `]' and
`-'.
- 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, 2021/05/19
- 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 <=
- 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
- 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
- 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
- Re: [External] : Use the characters "+" and "-" in regular expressions, tomas, 2021/05/20