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

Re: Un-patch: new pattern matching code



On Aug 9, 12:21pm, Andrej Borsenkow wrote:
} Subject: RE: Un-patch: new pattern matching code
}
} >
} > There is ${(MSI:n:)...#...}, where n is a number.  BTW, it looks like (M)
} > doesn't work right with ${.../...}.  Am I missing something?
} 
} At least, this is explicitly stated in the manual :-)

D'oh!  I even edited that text when it appeared.  But clearly it ought to be
repeated in the "Parameter Flags" subsection.

Index: Doc/Zsh/expn.yo
===================================================================
@@ -697,8 +697,9 @@
 )
 enditem()
 
-The following flags are meaningful with the tt(${)...tt(#)...tt(}),
-tt(${)...tt(%)...tt(}), or tt(${)...tt(/)...tt(}) forms.
+The following flags are meaningful with the tt(${)...tt(#)...tt(}) or
+tt(${)...tt(%)...tt(}) forms.  The tt(S) and tt(I) flags may also be
+used with the tt(${)...tt(/)...tt(}) forms.
 
 startitem()
 item(tt(S))(

} What would you like to do with (M) in this case?

I was expecting it to reverse the sense of the pattern match, and thus
substitute the NON-matching substrings by the replacement string.  However,
it's probably more sensible the way it is.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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