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

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

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


From: Jean Louis
Subject: Re: [External] : Use the characters "+" and "-" in regular expressions
Date: Fri, 21 May 2021 08:48:37 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* steve-humphreys@gmx.com <steve-humphreys@gmx.com> [2021-05-20 17:28]:
> I have settled with
> 
>   (string-match "^[:blank:]*$" s)
> 
> This would match only strings with spaces, not sentences with
> spaces.  What do you think?

That one is good to match nothing:

(string-match "^[:blank:]*$" "") ⇒ 0

(string-match "^[:blank:]*$" " ") ⇒ nil

(string-match "^[:blank:]*$" "  ") ⇒ nil

You have to read the manual: (info "(elisp) Regular Expressions")

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




reply via email to

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