Meaning of "\z" escape

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Meaning of "\z" escape

Tim Hill
Just looking for a clarification of the \z escape in strings. The ref manual says it eats all the following whitespace characters in the string. By "whitespace" does it mean whitespace BEFORE or AFTER converting other escapes? In other words, does it swallow "<a href="smb://x20">\\x20" and "\t" ??

And yes, I've tested this, and the answer seems to be that it only eats literal whitespace, not escaped whitespace, I'm just concerned if this is implementation specific or if its a strong guarantee of the language (and yes, I am using this difference in an application).

TIA,
--Tim
Reply | Threaded
Open this post in threaded view
|

Re: Meaning of "\z" escape

Roberto Ierusalimschy
> Just looking for a clarification of the \z escape in strings. The
> ref manual says it eats all the following whitespace characters in
> the string. By "whitespace" does it mean whitespace BEFORE or AFTER
> converting other escapes? In other words, does it swallow "\\x20" and
> "\t" ??

If it did, we would be able to write "a" as "\x\x36\x31" :)

-- Roberto