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

Re: (#m) and "case" alternation



On Nov 11, 12:54pm, Stephane Chazelas wrote:
}
} Some unexpected behaviour:
} 
} $ case abc in ((#m)a* | b*) echo $MATCH; esac

It shouldn't be unexpected, because it's documented:

m
     Set references to the match data for the entire string matched;
     this is similar to backreferencing and does not work in filename
     generation.  THE FLAG MUST BE IN EFFECT AT THE END OF THE PATTERN,
     i.e. NOT LOCAL TO A GROUP.

(all-caps mine).



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