Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: <n> == <n->?



Johan Sundstr m wrote:
> Another thing I forgot at first when on the subject: for quite some time
> now, <x-y> has been ungreedy about its matches, to my disappointment. This
> means that <1-2>* will match 1, 2, 10 through 29, and so on, instead of a
> single, closed range, as at leas I would hope when constructing such a
> pattern.

I thought about this when I changed it, and came to the conclusion that the
new behaviour was a simple matter of consistency with patterns.  *
guarantees to match anything at all, so 123potato is bound to match <1-2>*.
I don't think it's an option to make * not match numbers in this one case.
You probably don't need to be told all the workarounds; I suppose the
simplest is <1-2>[^0-9]*.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxxxxxxxxxxxxxxxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



Messages sorted by: Reverse Date, Date, Thread, Author