Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Quantifier ( braces in regexp )
- X-seq: zsh-users 11659
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: antho.charles@xxxxxxxxx
- Subject: Re: Quantifier ( braces in regexp )
- Date: Mon, 23 Jul 2007 09:48:02 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20070723073116.GA5210@xxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: antho.charles@xxxxxxxxx, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070723073116.GA5210@xxxxxxxxxxxxxxxxxxxxx>
On Mon, Jul 23, 2007 at 09:31:17AM +0200, antho.charles@xxxxxxxxx wrote:
> Hi everyone,
>
> I search through the doc and I can't find a way to use quantifier in
> expression like [0-9]{2,3} in standard regexp. Is there only * (#), + (##)
> and ? (|) implemented?
[...]
I don't think there is and it's true that's a missing one, I'd
say.
Recent ksh93s have {n,p}(expr).
In zsh, you can do something like:
${(l:20::?:)~:-} for .{20}
and
${(l:20::?:)~:-}${(l:40::(?|))~:-}
for .{20,30}
but that's a bit convoluted.
See also ${${(r:30:):-${(l:20::.:):-}}:gs: :(?|)::gs/./?}
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author