Nmap Development mailing list archives

Re: [nmap-svn] r33632 - in nmap: nselib scripts


From: Daniel Miller <bonsaiviking () gmail com>
Date: Wed, 3 Sep 2014 11:07:57 -0500

On Wed, Sep 3, 2014 at 9:44 AM, Patrick Donnelly <batrick () batbytes com>
wrote:


For future reference, Lua 5.2 offers the \z escape sequence which
skips all whitespace characters following it in a literal string:

http://www.lua.org/manual/5.2/manual.html#3.1

The escape sequence '\z' skips the following span of white-space
characters, including line breaks; it is particularly useful to break
and indent a long literal string into multiple lines without adding
the newlines and spaces into the string contents.


Patrick,

I was aware of \z, and I've used it in the past. For this run-through,
though, I found concatenation to be the simplest visually and with the
substitutions I was doing. As you pointed out, some of these require
concatenations anyway, and multiple concatenations are not really more
expensive than singles.

It does remind me that I want to see if my lua-indent.vim [1] can be
modified to indent \z strings :)

Dan


[1] https://gist.github.com/bonsaiviking/8845871
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: