Anton Shestakov <engored@ya.ru>, Mon, 15 Sep 2014 20:51:49 +0900
Redo formatting sections, add .format().
Common Format Presentation -------------------------- signed hexadecimal
*lowercase*,
*uppercase* floating point exponential format
*lowercase*,
*uppercase* floating point decimal format
floating point format, decimal or
*lowercase*,
*uppercase* exponential
single character (accepts integer or single character string)
Format Presentation for % ------------------------- same as
``s``, but converts any object using
``repr()``Format Presentation for .format() --------------------------------- ``d`` or
``g`` with locale-specific characters
percentage, like
``f``, but multiplies the number by 100 and adds a percent
Formatting with .format() ------------------------- ``"{"[field_name]["!"conversion][":"format_spec]"}"`` format_spec:
``[[fill]align][sign]["#"]["0"][width][","]["."precision][type]`` align to left (default for most objects)
align to right (default for numbers)
padding between sign and digits (
``+000000120``, valid only for numbers)
sign-aware zero-padding for numeric types (like
``{:0=}``)
comma as thousands sparator (l10n: use
``n``)
<div style="max-width: 600px;">
the group matches the empty string; the letters set the corresponding flags
a non-capturing version of regular parentheses
the substring matched by the group is accessible via the symbolic group
matches whatever text was matched by the earlier named group named
the contents of the parentheses are simply ignored
lookahead assertion: matches next, but doesn't consume any of the string
negative lookahead assertion
lookbehind assertion: matches a preceding string
negative lookbehind assertion, patterns which start with it may match at
the beginning of the string being searched
``(?(id/name)yes-pattern|no-pattern)`` sorcery.
``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>)``