- Method split_quoted_string
array(string) split_quoted_string(string s, int(0..1)|void nt_mode)
Splits the given string into a list of arguments, according to common (i.e.
/bin/sh-based) command line quoting rules:
Sequences of whitespace, i.e. space, tab,
\r, are treated as argument separators by default.
Single or double quotes (
") can be used around an argument to avoid whitespace splitting inside it. If such quoted strings are used next to each other then they get concatenated to one argument; e.g.
a"b"'c'becomes a single argument
\) can be used in front of one of the space or quote characters mentioned above to treat them literally. E.g.
x\ yis a single argument with a space in the middle, and
x\"yis a single argument with a double quote in the middle.
A backslash can also be used to quote itself; i.e.
Backslashes in front of other characters are removed by default. However, if the optional nt_mode flag is set then they are retained as-is, to work better with Windows style paths.
Backslashes are treated literally inside quoted strings, with the exception that
\"is treated as a literal
"-quoted string. It's therefore possible to include a literal
"-quoted string, as opposed to
'-quoted strings which cannot contain a