1.7 markers
A backslash in the first position on a new line indicates the start of a
marker. The backslash is not part of the marker:
|
>>> f = toolbox.StandardFormat()
>>> f.open_string('\\mk a value\n')
>>> list(f.fields())
[('mk', 'a value')]
|
|
If the backslash occurs later in the line it does not indicate the start
of a marker:
|
>>> f = toolbox.StandardFormat()
>>> f.open_string('\\mk a value\n \\mk another one\n')
>>> list(f.raw_fields())
[('mk', 'a value\n \\mk another one')]
|
|
There is no specific limit to the length of a marker:
|
>>> f = toolbox.StandardFormat()
>>> f.open_string('\\this_is_an_extremely_long_marker value\n')
>>> list(f.fields())
[('this_is_an_extremely_long_marker', 'value')]
|
|
A marker can contain any non white space character:
|
>>> f = toolbox.StandardFormat()
>>> f.open_string('\\`~!@#$%^&*()_-=+[{]}\|,<.>/?;:"0123456789 value\n')
>>> list(f.fields())
[('`~!@#$%^&*()_-=+[{]}\\|,<.>/?;:"0123456789', 'value')]
|
|
A marker is terminated by any white space character:
|
>>> f = toolbox.StandardFormat()
>>> f.open_string('\\mk a value\n\\mk\tanother one\n\\mk\rthird one\n\\mk\ffourth one')
>>> list(f.fields())
[('mk', 'a value'), ('mk', 'another one'), ('mk', 'third one'), ('mk', 'fourth one')]
|
|
Consecutive whitespace characters (except newline) are treated the same as one:
|
>>> f = toolbox.StandardFormat()
>>> f.open_string('\\mk \t\r\fa value\n')
>>> list(f.fields())
[('mk', 'a value')]
|
|