A
axel
Abigail said:(e-mail address removed) ([email protected]) wrote on
MMMMDXXXVII September MCMXCIII in <URL:-:
-: I still believe (\s|\S) -- without the unnecessary /ms -- is a
-: useful idiom here
-: to guarantee removal of the trailing character.
[You mean (\z|\Z) here - as pointed out].
I disagree. I do not see the point of (\z|\Z). I don't think there's anything
that is matched by \z that isn't matched by \Z.
Could you give an example of a match (or substitution) where using '(\z|\Z)'
gives a different result from using '\Z'?
For single line strings it is usually a good idea to chomp them as
soon as they have been read in from an external data source and
then only explicitly use a separate newline when it comes to the
output stage - it avoids all sorts of problems.
Axel