Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Extended glob patterns in ${...#..} RE: Un-patch: new pattern matching code
- X-seq: zsh-workers 7398
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Zsh hackers list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Re: Extended glob patterns in ${...#..} RE: Un-patch: new pattern matching code
- Date: Mon, 9 Aug 1999 04:25:34 +0000
- In-reply-to: <001101bee185$67ad4060$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <001101bee185$67ad4060$21c9ca95@xxxxxxxxxxxxxx>
On Aug 8, 2:04pm, Andrej Borsenkow wrote:
} Subject: Extended glob patterns in ${...#..} RE: Un-patch: new pattern mat
}
} > There is ${(MSI:n:)...#...}, where n is a number.
}
} It looks, like this does not work with extended glob patterns (3.1.6 pure or
} pws-1):
}
} bor@itsrm2:~%> print ${(SM)foo#([[:digit:]])#}
This is at least partly consistent:
zagzig<7> foo=ab12xy
zagzig<8> print ${(SM)foo#*}
zagzig<9>
Since a closure can match the empty string, the shortest matched portion
is nothing. However, asking for the longest match definitely doesn't work:
zagzig<9> print ${(SM)foo##*}
ab12xy
zagzig<10> print ${(SM)foo##([[:digit:]])#}
zagzig<11>
} there is subtle problem: searching for "...sub1 ...sub2..." may give
} different results as searching for sub1 first and then for sub2
True.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author