- starts with '%',
- is optionally followed by
a positive integer m, then '$', or
- a positive integer m, then ':', then a positive integer m₂ ≥ m, then '$',
- a positive integer m, then ':', then '$', or
+ a positive integer m, then ':', then a positive integer m₂ ≥ m, then '$', or
+ a positive integer m, then ':', then '$',
- is optionally followed by a sequence of flags, each being one of
'+', '-', ' ', '0', '#', '=',
- is optionally followed by a width specification:
They are implemented in lua-5.2.4/src/lstrlib.c.
A directive
- - starts with '%'
+ - starts with '%',
- is optionally followed by any of the characters '0', '-', ' ', or
each of which acts as a flag,
- is optionally followed by a width specification: a nonempty digit
- is optionally followed by '.' and a precision specification: an optional
nonempty digit sequence with at most 2 digits,
- is finished by a specifier
- - 's', 'q', that needs a string argument,
+ - 's', 'q', that need a string argument,
- 'd', 'i', 'o', 'u', 'X', 'x', that need an integer argument,
- 'A', 'a', 'E', 'e', 'f', 'G', 'g', that need a floating-point argument,
- 'c', that needs a character argument.