From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28306 invoked by alias); 8 Oct 2015 16:46:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20710 Received: (qmail 8095 invoked from network); 8 Oct 2015 16:46:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=dEP/t3zKOO01mbhlAzqBBJ6SYVIutxQmzSIe8oJU5Lk=; b=XVeZcG4Q5qwjpSIkkQFr0pY5Ief/P/rhc3/I0n2Mz/CJNvnVp87PIGQTGT4UIILOc9 sYqoF/19OPYdeVDgRrpTKgSsx3MAz3aN2QCQOPJnj15zw2ubo6JXLhNyX9hphEQiYjXI mPkx3CEx47cJXQNKrhK10U1yQsKXTXczN50CbSkq3sDN31N1eLfxu2GdMr90W6cvLoEj qkCIW6L8cTwzwJ/BM+X17j3ONqL/TCAAqscKPLyJ8m/yHPCEhRIe0UY8G05wapS2Fe1n j8qcFVC12UhKo2QnxC3oEnHNY65oN6R955y/hqY+QjmUWQY+ouYNQJLfqZzCdZWxqeAw b3PQ== X-Gm-Message-State: ALoCoQmLBBcscLigZFmCcBeB9FHhgnMx1YXLUPoLVfwVkzFxSGORldVvJ/FbfgCVm5GwEMfLnB/q X-Received: by 10.182.91.80 with SMTP id cc16mr5210027obb.19.1444322807023; Thu, 08 Oct 2015 09:46:47 -0700 (PDT) From: Bart Schaefer Message-Id: <151008094643.ZM4110@torch.brasslantern.com> Date: Thu, 8 Oct 2015 09:46:43 -0700 In-Reply-To: <20151008102315.0136766a@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: Matching beginning and end of word" (Oct 8, 10:23am) References: <20151008102315.0136766a@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Matching beginning and end of word MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 8, 10:23am, Peter Stephenson wrote: } } We do have the special chracter range [[:WORD:]]. So I think you need } to check both possibilities, using the (#s) for start (or (#e) for end) } that Bart pointed out yesterday. The problem is that [^[:WORD:]] matches one character, whereas \< \> match an empty string in between two characters. It's difficult if not impossible construct a generic pattern for that. Whether you can achieve the desired effect depends on the context; Peter's answer is fine if you're simply comparing, but if an s/// repacement is desired you have to be more careful.