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

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

Re: Difference between \\w and [:word:]?


From: Robert Pluim
Subject: Re: Difference between \\w and [:word:]?
Date: Thu, 07 Jun 2018 22:24:04 +0200

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Can someone explain to me what's happening here? What's the difference
> between \\w and [:word:], inside and outside of a bracket construction?
>
> (setq case-fold-search nil)
> (string-match-p "[:word:]" "P") => nil
> (string-match-p "[[:word:]]" "P") => 0
> (string-match-p "\\w" "P") => 0
> (string-match-p "[\\w]" "P") = nil

Consider

(string-match-p "[\\w]" "w") => ?

Robert




reply via email to

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