From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.help Subject: Re: Match empty string at begin/end of symbol Date: Wed, 4 Jul 2018 15:21:07 -0400 Message-ID: References: <20180704114346.73df0142@gauss> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1530731973 18678 195.159.176.226 (4 Jul 2018 19:19:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2018 19:19:33 +0000 (UTC) Cc: Help GNU Emacs To: Joe Riel Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 21:19:28 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 1fanJI-0004m5-Fa for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2018 21:19:28 +0200 Original-Received: from localhost ([::1]:48913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fanLP-0007tZ-JM for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2018 15:21:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fanKv-0007sp-QR for help-gnu-emacs@gnu.org; Wed, 04 Jul 2018 15:21:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fanKv-0001cD-4e for help-gnu-emacs@gnu.org; Wed, 04 Jul 2018 15:21:09 -0400 Original-Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]:41534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fanKu-0001c1-V1 for help-gnu-emacs@gnu.org; Wed, 04 Jul 2018 15:21:09 -0400 Original-Received: by mail-oi0-x231.google.com with SMTP id k12-v6so12476640oiw.8 for ; Wed, 04 Jul 2018 12:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cacqTTBDVGlXr7yNSYmDQI+3bvP+UO7fdsG2YQyNtOw=; b=dNHU0Ben+X8L0Ti9P4sW4sr/Mmh3ZRyUc9AfKCMdcz/uyrZBfzJCPIumAJwrFlurXE vLeZ/Ti31vfdEW6SA4FbDVabGMsxXfPdqhB1uUnKsefjT2RmMm9ZiXrL5qDKBqeutFRt Kv6hDF5LTrKnZSyd4a2kBbc622YKyZD2UvMCjaQN7RgS0MZssUOQ35q+PgnOHWDPNLvG jw+20jR55miphOgZgObQYS16+lLvHY6CR4j/ZBUK8F1HJuCHyvJtp38z5Wy0bkP10Asa X8JP0UUHjzrWz7+SnnNghQeerr9V4oc20tq6FmeQ0BGrAQBy6wB9qVZUa+7QwKLqmliU dOlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cacqTTBDVGlXr7yNSYmDQI+3bvP+UO7fdsG2YQyNtOw=; b=nc22nPE32RtCou6+JUNF9ak3PYIVUSwFbtco3reF2gxngcPs0wT48N73rP/YT7zYEn 7k/xuH4IflnauEa7Qb+B/nLvNqUVaaE7nRe+TIjfl/EDapIkOgKIOH4E4Ul3d/pjaYQC XsFnC0XTD4BUN9+pxazjEu1QAh9EyI4TGe1Uqv+eGzJgVQEYNdYCUTylvcziWZvVevuA VITR6sAB1U868XVaXFqAbDCrT1y5tPosrQeHV+gw3F4zfIvFDYk7u8iWQFQwgCUyMDNH EijJV9NxYpVdJ1P+9fqVY8/gWdZMrEGFCbSaFb2m+Sgf/9+k8kzuJHK7Px5QLXMdC4Em MOdg== X-Gm-Message-State: APt69E3SogNxANuCy9J/UhOrY3TyCLQG3qGMaGAVB1cDh6KbxznlS4jC a2aGX1BeN71GrLz5dAcQGvDEGyJXp2JelhV/aZU= X-Google-Smtp-Source: AAOMgpcBOq0iTs96x1g1Ca6XFVj1hFGUYpJg6LhGl3c3EN4/45OtY73pzQdKIThqzfdVWPVom8jo5fkhMr1f6KdSZVQ= X-Received: by 2002:aca:4ac6:: with SMTP id x189-v6mr3665039oia.211.1530732068328; Wed, 04 Jul 2018 12:21:08 -0700 (PDT) Original-Received: by 2002:a4a:3b8d:0:0:0:0:0 with HTTP; Wed, 4 Jul 2018 12:21:07 -0700 (PDT) In-Reply-To: <20180704114346.73df0142@gauss> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::231 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:117347 Archived-At: On 4 July 2018 at 14:43, Joe Riel wrote: > That returns "ab", as expected. Change the "\\<" to "\\_<" > and it no longer matches. Why not? > > (let ((str "3+ab")) > (and (string-match "\\_<[a-zA-Z][a-zA-Z0-9]*" str) > (match-string 0 str))) "+ab" all have symbol syntax in lisp-mode, try evaluating it from a c-mode buffer and you will get "ab".