Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: =~ regex match
- X-seq: zsh-workers 23328
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: =~ regex match
- Date: Wed, 25 Apr 2007 22:12:39 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=first1; d=spodhuis.org; h=Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=hjg+I9kIxcs+UhoA5iiMk8yFeZSzsEt8ZQP+b4BoROCOCMgcWk0NgBtukG6kpDLVN33DF5nz2OEm6l3gx8sF/bV6hHvcpqHatsvnyZoP/n3aVshmWnIXsD4qHO8Snk9+NUObkXEjbeXo6tFEtPb4uCb5Ek8YMdZG+PBd5KFFahQ=;
- In-reply-to: <20070426041938.GA44533@xxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20070426041938.GA44533@xxxxxxxxxxxxxxxxxxxx>
On 2007-04-25 at 21:19 -0700, Phil Pennock wrote:
> The below patch makes =~ an operator which silently auto-loads zsh/pcre
> and uses -pcre-match from there.
Documentation probably a good thing.
Index: Doc/Zsh/cond.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/cond.yo,v
retrieving revision 1.3
diff -p -u -r1.3 cond.yo
--- Doc/Zsh/cond.yo 22 May 2000 15:01:35 -0000 1.3
+++ Doc/Zsh/cond.yo 26 Apr 2007 05:11:00 -0000
@@ -109,6 +109,11 @@ backward compatibility and should be con
item(var(string) tt(!=) var(pattern))(
true if var(string) does not match var(pattern).
)
+item(var(string) tt(=~) var(regexp))(
+true if var(string) matches the PCRE regular expression
+var(regexp). Requires the tt(zsh/pcre) module to be present,
+which is a compile-time option.
+)
item(var(string1) tt(<) var(string2))(
true if var(string1) comes before var(string2)
based on ASCII value of their characters.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author