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

Re: MBEGIN, MEND in #m when pattern has "|"



On Jun 2,  7:41pm, Sebastian Gniazdowski wrote:
}
} below is a code that uses indexes set by (#m) or (#b). Turns out the
} indexes are set only when using (#b). For (#m) they are set when there
} is no "|" in the pattern. Why?

MATCH MBEGIN and MEND are set only if there is a single possible match
(more precisely, when the string can be matched with only a combination
of strcmp() and simple wildcards).  In //pat/repl/, there are multiple
possible match positions; which begin and end do you want?

This probably should have been documented better.



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