From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.help Subject: Re: Difference between \\w and [:word:]? Date: Thu, 07 Jun 2018 22:24:04 +0200 Message-ID: <87y3fq5orf.fsf@gmail.com> References: <87y3fqquaq.fsf@ericabrahamsen.net> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528402959 3333 195.159.176.226 (7 Jun 2018 20:22:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2018 20:22:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 07 22:22:35 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fR1QY-0000m4-CQ for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 22:22:34 +0200 Original-Received: from localhost ([::1]:60044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR1Sf-0006mS-JO for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 16:24:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR1SF-0006mB-O5 for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 16:24:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fR1SC-0005zN-Iz for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 16:24:19 -0400 Original-Received: from [195.159.176.226] (port=57411 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fR1SC-0005r8-Ah for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 16:24:16 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fR1Q3-000080-28 for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 22:22:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 16 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:iwp9H6DOw08xfNmZhVl8goTXI1A= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117026 Archived-At: Eric Abrahamsen 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