-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering the Nmap Scripting Engine
By :
Lua's string library supports a lot of handy string operations. Strings will obviously be used frequently when writing NSE scripts since they are perfect for representing byte sequences. Let's review the most common functions and operators used in string handling.
Character classes are special operators used in patterns. We will need them when matching or subtracting substrings, so keep them in mind when we review patterns and string operations:
|
Character classes |
Represents |
|---|---|
|
|
All characters |
|
|
Letters |
|
|
Control characters |
|
|
Digits |
|
|
Lowercase letters |
|
|
Punctuation characters |
|
|
Space characters |
|
|
Uppercase letters |
|
|
Alphanumeric characters |
|
|
Hexadecimal digits |
|
|
Null (0x90) |
The following characters have special functions within patterns:
|
Operator |
Function |
|---|---|
|
|
Parentheses encapsulate the pattern to capture |
|
|
Any character |
|
|
Escape character for magic characters and non-alphanumeric characters |
|
|
Repetition... |
Change the font size
Change margin width
Change background colour