From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Difference between \\w and [:word:]? Date: Thu, 07 Jun 2018 12:18:53 -0700 Message-ID: <87y3fqquaq.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528399070 24728 195.159.176.226 (7 Jun 2018 19:17:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2018 19:17:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) 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 21:17:46 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 1fR0Pp-0006J2-Ct for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 21:17:45 +0200 Original-Received: from localhost ([::1]:59848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR0Rw-0003bY-ED for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 15:19:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR0RA-0003ZQ-BB for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 15:19:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fR0R5-0007Lp-Ax for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 15:19:08 -0400 Original-Received: from [195.159.176.226] (port=44962 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fR0R5-0007H1-33 for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 15:19:03 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fR0Ot-0005Em-Vn for help-gnu-emacs@gnu.org; Thu, 07 Jun 2018 21:16:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 8 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:Sz4ukQryLygVESRoR2NG4hV3l1w= 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:117024 Archived-At: 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