help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use the characters "+" and "-" in regular expressions


From: Skip Montanaro
Subject: Re: Use the characters "+" and "-" in regular expressions
Date: Wed, 19 May 2021 11:17:34 -0500

> 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

>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]