<indentfold># comment with ALERT

</indentfold><beginfold id='1'>'''</beginfold id='1'> multiline
    comment
    ###
<indentfold>    <endfold id='1'>'''</endfold id='1'>

// alert check, no word delimiter check at start of word, bug 397719
#TODO

import itertools
from itertools import accumulate as A
lazy import itertools
lazy from itertools import accumulate as A
lazy = 42

a = 100_000
b = 856_264.65
c = 0x420_F52

def func<beginfold id='2'>(</beginfold id='2'>x<endfold id='2'>)</endfold id='2'>:
    <beginfold id='3'>"""</beginfold id='3'> EXTENDED API docs <endfold id='3'>"""</endfold id='3'>
    if x == 42:
        func<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>
        c1 = <beginfold id='4'>{</beginfold id='4'><endfold id='4'>}</endfold id='4'>
</indentfold>        c2 = <beginfold id='4'>{</beginfold id='4'>
            2.4,
            0x42,
<indentfold>            <endfold id='4'>}</endfold id='4'>
        a1 = <beginfold id='5'>[</beginfold id='5'><endfold id='5'>]</endfold id='5'>
</indentfold>        a2 = <beginfold id='5'>[</beginfold id='5'>
            "a", 032, <beginfold id='2'>(</beginfold id='2'>
<indentfold>                <endfold id='2'>)</endfold id='2'><endfold id='5'>]</endfold id='5'>
    else:
</indentfold>        print<beginfold id='2'>(</beginfold id='2'><beginfold id='3'>"""</beginfold id='3'>multi
            line
<indentfold>            string<endfold id='3'>"""</endfold id='3'><endfold id='2'>)</endfold id='2'>
        print<beginfold id='2'>(</beginfold id='2'>"single \
                continued line "<endfold id='2'>)</endfold id='2'>
        print<beginfold id='2'>(</beginfold id='2'>'single line'<endfold id='2'>)</endfold id='2'>
    if y := x:
        anext<beginfold id='2'>(</beginfold id='2'>a<endfold id='2'>)</endfold id='2'>
    return float<beginfold id='2'>(</beginfold id='2'>len<beginfold id='2'>(</beginfold id='2'>a2<endfold id='2'>)</endfold id='2'><endfold id='2'>)</endfold id='2'>


def test_f_literals<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>:
    f'xy'
    f'x{bar}y'
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>}y'
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>}y\n'

    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>!r}y\n'
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}y\n'

    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}y\n'
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:._f}y\n'
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.3_f}y\n'
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:._3f}y\n' # bad format
    f'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.f}y\n' # bad format

    f'{{x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}}}} }} {{ {x!a}'
                        # ^ oups

def test_t_literals<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>:
    t'x{bar}y'
    t'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>}y\n'
    t'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}y\n'
    t'{{x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}}}} }} {{ {x!a}'
                        # ^ oups
    tr'x{bar}y'
    tr'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>}y\n'
    tr'x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}y\n'
    tr'{{x{bar<beginfold id='5'>[</beginfold id='5'>"baz"<endfold id='5'>]</endfold id='5'>:.2}}}} }} {{ {x!a}'
                         # ^ oups

a = "Escapes in String \U12345678 \xAB \""
</indentfold>a = <beginfold id='1'>u'''</beginfold id='1'>\'''
<indentfold><endfold id='1'>'''</endfold id='1'>
a = <beginfold id='1'>u'''</beginfold id='1'>\'<endfold id='1'>'''</endfold id='1'>
a = b'\u1234a\xffé\12k\n\g\
s\
\"\ '
a = Rb'\u1234aé\n\g\
'
a = <beginfold id='3'>b"""</beginfold id='3'><endfold id='3'>"""</endfold id='3'>
a = <beginfold id='3'>b"""</beginfold id='3'>\"<endfold id='3'>"""</endfold id='3'>
a = 'a' \
    u'\x12'
a = b"t\e's\t"
a = Rb"t\e's\t"
a = R"\\" \
Rb'\\' \
<beginfold id='3'>Rf"""</beginfold id='3'>\\<endfold id='3'>"""</endfold id='3'> \
<beginfold id='1'>uR'''</beginfold id='1'>\\<endfold id='1'>'''</endfold id='1'>

# regex (re and regex package)
#{
# r'...'
patt = r'a+é??a?*a{x,}a{,}a{1}a{1,}a{,2}a{1,2}\g<12>\L<name>\g<name>\w.\'\b\\a#$'
             # ~~ invalid, but ok
patt = r'\p{H}\x12\u1234\1\023\0234\123\1234\12'
patt = r'(a)(?:a)(?=a)(?R)(?r)(?a-m:a)(?oups)(?P<name>a)(?|a|b)(?#comment\)\'\")(?>=a)\
    (?(1)a|b))a(?(?!a)a|b)'
      # oups ~
patt = r'[^xy-z]|[]xy[:alpha:]z]|[[\wa(){}\b\]\[\..]|[[a-z]--[c]]'
                                          # regex V1 ~~~~~~~~~~~~
patt = r'(((a)))(?:(?!(?<a>a("\'\"))))'
patt = r'(?:(?!(?<a>a(\
.' # break

# r"..."
patt = r"a+é??a?*a{x,}a{,}a{1}a{1,}a{,2}a{1,2}\g<12>\L<name>\g<name>\w.\"\b\\a#$"
             # ~~ invalid, but ok
patt = r"\p{H}\x12\u1234\1\023\0234\123\1234\12"
patt = r"(a)(?:a)(?=a)(?R)(?r)(?a-m:a)(?oups)(?P<name>a)(?|a|b)(?#comment\)\'\")\
    (?>=a)(?(1)a|b))a(?(?!a)a|b)"
            # oups ~
patt = r"[^xy-z]|[]xy[:alpha:]z]|[[\wa(){}\b\]\[\..]|[[a-z]--[c]]"
                                          # regex V1 ~~~~~~~~~~~~
patt = r"(((a)))(?:(?!(?<a>a(\'\"'))))"
patt = r"(?:(?!(?<a>a(\
." # break

# r'''...'''
</indentfold>patt = <beginfold id='1'>r'''</beginfold id='1'>
    a+é??a?*
        # ~~ invalid, but ok
    a{x,}a{{,}}a{1}a{1,}a{,2}a{1,2}  # bla bla
    \g<12>\L<name>\g<name>
    \w.''\'\b\\a\#\p{H}\x12\u1234\1\023\0234\123\1234\12$
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>r'''</beginfold id='1'>
    <beginfold id='6'>(</beginfold id='6'>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?=a<endfold id='6'>)</endfold id='6'>(?R)(?r)<beginfold id='6'>(</beginfold id='6'>?a-m:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?ou\
        ps<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<name>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?|a|b<endfold id='6'>)</endfold id='6'>
    a<beginfold id='6'>(?#</beginfold id='6'>comment\)\'\"''""<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?>=a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(?#</beginfold id='6'>bla
     bla<endfold id='6'>)</endfold id='6'>abc
    <beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>1<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!a<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>
      # oups ~
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>r'''</beginfold id='1'>
    [^xy-\
        z]
    []xy[:alpha:]
    z]
    [[\wa(){}\b\]\[\..]
    [[a-z]--[c]] # regex V1
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>r'''</beginfold id='1'><beginfold id='6'>(</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>
        <beginfold id='6'>(</beginfold id='6'>
            a # bla
        <endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?!
        <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
            '" # bla
            abc\
                z
        <endfold id='6'>)</endfold id='6'><endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<indentfold><endfold id='6'>)</endfold id='6'><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>r'''</beginfold id='1'>
    <beginfold id='6'>(?:</beginfold id='6'>
         <beginfold id='6'>(</beginfold id='6'>?!
            <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
<indentfold>.<endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='1'>'''</endfold id='1'> # break

# r"""..."""
</indentfold>patt = <beginfold id='3'>r"""</beginfold id='3'>
    a+é??a?*
        # ~~ invalid, but ok
    a{x,}a{{,}}a{1}a{1,}a{,2}a{1,2}  # bla bla
    \g<12>\L<name>\g<name>
    \w.""\"\b\\a\#\p{H}\x12\u1234\1\023\0234\123\1234\12$
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>r"""</beginfold id='3'>
    <beginfold id='6'>(</beginfold id='6'>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?=a<endfold id='6'>)</endfold id='6'>(?R)(?r)<beginfold id='6'>(</beginfold id='6'>?a-m:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?ou\
        ps<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<name>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?|a|b<endfold id='6'>)</endfold id='6'>
    a<beginfold id='6'>(?#</beginfold id='6'>comment\)\'\"<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?>=a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(?#</beginfold id='6'>bla
     bla<endfold id='6'>)</endfold id='6'>abc
    <beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>1<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!a<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>
      # oups ~
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>r"""</beginfold id='3'>
    [^xy-\
        z]
    []xy[:alpha:]
    z]
    [[\wa(){}\b\]\[\..] # bla bla
    [[a-z]--[c]] # regex V1
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>r"""</beginfold id='3'><beginfold id='6'>(</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>
        <beginfold id='6'>(</beginfold id='6'>
            a # bla
        <endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?!
        <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
            '" # bla
            abc\
                z
        <endfold id='6'>)</endfold id='6'><endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<indentfold><endfold id='6'>)</endfold id='6'><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>r"""</beginfold id='3'>
    <beginfold id='6'>(?:</beginfold id='6'>
         <beginfold id='6'>(</beginfold id='6'>?!
            <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
<indentfold>.<endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='3'>"""</endfold id='3'> # break

# rb'...'
patt = rb'a+é??a?*a{x,}a{,}a{1}a{1,}a{,2}a{1,2}\g<12>\L<name>\g<name>\w.\'\b\\a#$'
     # oups ~   ~~ invalid, but ok
patt = rb'\p{H}\x12\u1234\1\023\0234\123\1234\12'
        # ~~ oups  ~~
</indentfold>patt = br'(a)(?:a)(?=a)(?R)(?r)(?a-m:a)(?oups)(?P<name>a)(?|a|b)(?#comment\)\'\")\
<indentfold>    (?>=a)(?(1)a|b))a(?(?!a)a|b)'
            # oups ~
patt = rb'[^xy-z]|[]xy[:alpha:]z]|[[\wa(){}\b\]\[\..]|[[a-z]--[c]]'
                                           # regex V1 ~~~~~~~~~~~~
patt = br'(((a)))(?:(?!(?<a>a("\'\"))))'
patt = rb'(?:(?!(?<a>a(\
.' # break

# rb"..."
patt = rb"a+é??a?*a{x,}a{,}a{1}a{1,}a{,2}a{1,2}\g<12>\L<name>\g<name>\w.\"\b\\a#$"
     # oups ~   ~~ invalid, but ok
patt = rb"\p{H}\x12\u1234\1\023\0234\123\1234\12"
        # ~~ oups  ~~
patt = br"(a)(?:a)(?=a)(?R)(?r)(?a-m:a)(?oups)(?P<name>a)(?|a|b)(?#comment\)\'\")\
    (?>=a)(?(1)a|b))a(?(?!a)a|b)"
            # oups ~
patt = rb"[^xy-z]|[]xy[:alpha:]z]|[[\wa(){}\b\]\[\..]|[[a-z]--[c]]"
                                           # regex V1 ~~~~~~~~~~~~
patt = br"(((a)))(?:(?!(?<a>a(\'\"'))))"
patt = rb"(?:(?!(?<a>a(\
." # break


# rb'''...'''
</indentfold>patt = <beginfold id='1'>rb'''</beginfold id='1'>
    a+é??a?*
        # ~~ invalid, but ok
    a{x,}a{,}a{1}a{1,}a{,2}a{1,2}  # bla bla
    \g<12>\L<name>\g<name>
    \w.''\'\b\\a\#\p{H}\x12\u1234\1\023\0234\123\1234\12$
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>br'''</beginfold id='1'>
    <beginfold id='6'>(</beginfold id='6'>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?=a<endfold id='6'>)</endfold id='6'>(?R)(?r)<beginfold id='6'>(</beginfold id='6'>?a-m:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?ou\
        ps<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<name>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?|a|b<endfold id='6'>)</endfold id='6'>
    a<beginfold id='6'>(?#</beginfold id='6'>comment\)\'\"''""<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?>=a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(?#</beginfold id='6'>bla
     bla<endfold id='6'>)</endfold id='6'>abc
    <beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>1<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!a<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>
      # oups ~
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>rb'''</beginfold id='1'>
    [^xy-\
        z]
    []xy[:alpha:]
    z]
    [[\wa(){}\b\]\[\..]
    [[a-z]--[c]] # regex V1
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>br'''</beginfold id='1'><beginfold id='6'>(</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>
        <beginfold id='6'>(</beginfold id='6'>
            a # bla
        <endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?!
        <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
            '" # bla
            abc\
                z
        <endfold id='6'>)</endfold id='6'><endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<indentfold><endfold id='6'>)</endfold id='6'><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>rb'''</beginfold id='1'>
    <beginfold id='6'>(?:</beginfold id='6'>
         <beginfold id='6'>(</beginfold id='6'>?!
            <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
<indentfold>.<endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='1'>'''</endfold id='1'> # break

# rb"""..."""
</indentfold>patt = <beginfold id='3'>rb"""</beginfold id='3'>
    a+é??a?*
        # ~~ invalid, but ok
    a{x,}a{,}a{1}a{1,}a{,2}a{1,2}  # bla bla
    \g<12>\L<name>\g<name>
    \w.""\"\b\\a\#\p{H}\x12\u1234\1\023\0234\123\1234\12$
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>br"""</beginfold id='3'>
    <beginfold id='6'>(</beginfold id='6'>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?=a<endfold id='6'>)</endfold id='6'>(?R)(?r)<beginfold id='6'>(</beginfold id='6'>?a-m:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?ou\
        ps<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<name>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?|a|b<endfold id='6'>)</endfold id='6'>
    a<beginfold id='6'>(?#</beginfold id='6'>comment\)\'\"<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?>=a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(?#</beginfold id='6'>bla
     bla<endfold id='6'>)</endfold id='6'>abc
    <beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>1<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!a<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>
      # oups ~
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>rb"""</beginfold id='3'>
    [^xy-\
        z]
    []xy[:alpha:]
    z]
    [[\wa(){}\b\]\[\..] # bla bla
    [[a-z]--[c]] # regex V1
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>br"""</beginfold id='3'><beginfold id='6'>(</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>
        <beginfold id='6'>(</beginfold id='6'>
            a # bla
        <endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?!
        <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
            '" # bla
            abc\
                z
        <endfold id='6'>)</endfold id='6'><endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<indentfold><endfold id='6'>)</endfold id='6'><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>rb"""</beginfold id='3'>
    <beginfold id='6'>(?:</beginfold id='6'>
         <beginfold id='6'>(</beginfold id='6'>?!
            <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
<indentfold>.<endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='3'>"""</endfold id='3'> # break

# rf'...'
patt = rf'a+é??a?*\L<name>\L<{name}>\g<name>\g<{name}>\g<12>\w.\'\b\\a#'
              # ~~ invalid, but ok
patt = rf'\p{{H}}\p{name}\p{{{name}}}\x12\u1234\1\023\0234\123\1234\12$'
patt = rf'a{n}a{{x,}}a{{,}}a{{1}}a{{1,}}a{{,2}}a{{1,2}}a{{{n}}}a{{{n},}}a{{,{n}}}a{{{n},{n}}}'
patt = fr'(a)(?:a)(?=a)(?R)(?r)(?a-m:a)(?oups)(?P<name>a)(?|a|b)(?#comment\)\'\")\
    (?>=a)(?(1)a|b))a(?(?!a)a|b)'
            # oups ~
patt = fr'({x})(?={x})(?{x})(?{x}:a)(?oups)(?P<{x}>a)(?({x})a|b))a(?(?!{x}){y}|{y})'
                                                         # oups ~
patt = rf'[^x${x}y-z]|[]xy[:alpha:]z]|[[\wa}(){{}}\b\]\[\..]|[[a-z]--[c]]'
                                                  # regex V1 ~~~~~~~~~~~~
patt = fr'(((a)))(?:(?!(?<a>${x}a("\'\"))))'
patt = rf'(?:(?!(?<a>a(\
.${x}' # break

# rf"..."
patt = rf"a+é??a?*\L<name>\L<{name}>\g<name>\g<{name}>\g<12>\w.\'\b\\a#"
              # ~~ invalid, but ok
patt = rf"\p{{H}}\p{name}\p{{{name}}}\x12\u1234\1\023\0234\123\1234\12$"
patt = rf"a{n}a{{x,}}a{{,}}a{{1}}a{{1,}}a{{,2}}a{{1,2}}a{{{n}}}a{{{n},}}a{{,{n}}}a{{{n},{n}}}"
patt = fr"(a)(?:a)(?=a)(?R)(?r)(?a-m:a)(?oups)(?P<name>a)(?|a|b)(?#comment\)\'\")\
    (?>=a)(?(1)a|b))a(?(?!a)a|b)"
            # oups ~
patt = fr"({x})(?={x})(?{x})(?{x}:a)(?oups)(?P<{x}>a)(?({x})a|b))a(?(?!{x}){y}|{y})"
                                                         # oups ~
patt = rf"[^x${x}y-z]|[]xy[:alpha:]z]|[[\wa}(){{}}\b\]\[\..]|[[a-z]--[c]]"
                                                  # regex V1 ~~~~~~~~~~~~
patt = fr"(((a)))(?:(?!(?<a>${x}a('\"'))))"
patt = rf"(?:(?!(?<a>a(\
.${x}" # break


# rf'''...'''
</indentfold>patt = <beginfold id='1'>rf'''</beginfold id='1'>
    a+é??a?*
        # ~~ invalid, but ok
    a{n}a{{x,}}a{{,}}a{{1}}a{{1,}}a{{,2}}a{{1,2}}  # bla bla
    a{{{n}}}a{{{n},}}a{{,{n}}}a{{{n},{n}}}
    \L<name>\L<{name}>\g<name>\g<{name}>\g<12>
    \w.''\'\b\\a\#\p{{H}}\p{name}\p{{{name}}}\x12\u1234\1\023\0234\123\1234\12$
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>fr'''</beginfold id='1'>
    <beginfold id='6'>(</beginfold id='6'>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?=a<endfold id='6'>)</endfold id='6'>(?R)(?r)<beginfold id='6'>(</beginfold id='6'>?a-m:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?ou\
        ps<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<name>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?|a|b<endfold id='6'>)</endfold id='6'>
    a<beginfold id='6'>(?#</beginfold id='6'>comment\)\'\"''""<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?>=a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(?#</beginfold id='6'>bla {} {a} {{a}} }
     bla<endfold id='6'>)</endfold id='6'>abc
    <beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>1<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!a<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>
      # oups ~
    <beginfold id='6'>(</beginfold id='6'>{x}<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?={x}<endfold id='6'>)</endfold id='6'>(?{x})<beginfold id='6'>(</beginfold id='6'>?{x}:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?oups<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<{x}>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>{x}<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!{x}<endfold id='6'>)</endfold id='6'>{y}|{y}<endfold id='6'>)</endfold id='6'>
                                                   # oups ~
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>rf'''</beginfold id='1'>
    [^x${x}y-\
        z]
    []xy[:alpha:]
    z]
    [[\wa}(){{}}\b\]\[\..]
    [[a-z]--[c]] # regex V1
<indentfold><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>fr'''</beginfold id='1'><beginfold id='6'>(</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>
        <beginfold id='6'>(</beginfold id='6'>
            a # bla
        <endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?!
        <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
            '" # bla
            abc\
                z
        <endfold id='6'>)</endfold id='6'><endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<indentfold><endfold id='6'>)</endfold id='6'><endfold id='1'>'''</endfold id='1'>
</indentfold>patt = <beginfold id='1'>rf'''</beginfold id='1'>
    <beginfold id='6'>(?:</beginfold id='6'>
         <beginfold id='6'>(</beginfold id='6'>?!
            <beginfold id='6'>(</beginfold id='6'>?<a>${x}a<beginfold id='6'>(</beginfold id='6'>
<indentfold>.<endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='1'>'''</endfold id='1'> # break

# rf"""..."""
</indentfold>patt = <beginfold id='3'>rf"""</beginfold id='3'>
    a+é??a?*
        # ~~ invalid, but ok
    a{n}a{{x,}}a{{,}}a{{1}}a{{1,}}a{{,2}}a{{1,2}}  # bla bla
    a{{{n}}}a{{{n},}}a{{,{n}}}a{{{n},{n}}}
    \L<name>\L<{name}>\g<name>\g<{name}>\g<12>
    \w.""\"\b\\a\#\p{{H}}\p{name}\p{{{name}}}\x12\u1234\1\023\0234\123\1234\12$
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>fr"""</beginfold id='3'>
    <beginfold id='6'>(</beginfold id='6'>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?=a<endfold id='6'>)</endfold id='6'>(?R)(?r)<beginfold id='6'>(</beginfold id='6'>?a-m:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?ou\
        ps<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<name>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?|a|b<endfold id='6'>)</endfold id='6'>
    a<beginfold id='6'>(?#</beginfold id='6'>comment\)\'\"<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?>=a<endfold id='6'>)</endfold id='6'>
    <beginfold id='6'>(?#</beginfold id='6'>bla {} {a} {{a}} }
     bla<endfold id='6'>)</endfold id='6'>abc
    <beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>1<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!a<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>
      # oups ~
    <beginfold id='6'>(</beginfold id='6'>{x}<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?={x}<endfold id='6'>)</endfold id='6'>(?{x})<beginfold id='6'>(</beginfold id='6'>?{x}:a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?oups<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?P<{x}>a<endfold id='6'>)</endfold id='6'><beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>{x}<endfold id='6'>)</endfold id='6'>a|b<endfold id='6'>)</endfold id='6'>)a<beginfold id='6'>(</beginfold id='6'>?<beginfold id='6'>(</beginfold id='6'>?!{x}<endfold id='6'>)</endfold id='6'>{y}|{y}<endfold id='6'>)</endfold id='6'>
                                                   # oups ~
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>rf"""</beginfold id='3'>
    [^x${x}y-\
        z]
    []xy[:alpha:]
    z]
    [[\wa}(){{}}\b\]\[\..] # bla bla
    [[a-z]--[c]] # regex V1
<indentfold><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>fr"""</beginfold id='3'><beginfold id='6'>(</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>
        <beginfold id='6'>(</beginfold id='6'>
            a # bla
        <endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<endfold id='6'>)</endfold id='6'><beginfold id='6'>(?:</beginfold id='6'>
    <beginfold id='6'>(</beginfold id='6'>?!
        <beginfold id='6'>(</beginfold id='6'>?<a>a<beginfold id='6'>(</beginfold id='6'>
            '" # bla
            abc\
                z
        <endfold id='6'>)</endfold id='6'><endfold id='6'>)</endfold id='6'>
    <endfold id='6'>)</endfold id='6'>
<indentfold><endfold id='6'>)</endfold id='6'><endfold id='3'>"""</endfold id='3'>
</indentfold>patt = <beginfold id='3'>rf"""</beginfold id='3'>
    <beginfold id='6'>(?:</beginfold id='6'>
         <beginfold id='6'>(</beginfold id='6'>?!
            <beginfold id='6'>(</beginfold id='6'>?<a>${x}a<beginfold id='6'>(</beginfold id='6'>
<indentfold>.<endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='6'></endfold id='6'><endfold id='3'>"""</endfold id='3'> # break
#}

"Escapes in Doc/Comment String \u1234 \xAb \"\\"
<beginfold id='1'>'''</beginfold id='1'> Doc/Comment String \N{123} \'<endfold id='1'>'''</endfold id='1'>
<beginfold id='3'>"""</beginfold id='3'> Doc/Comment String \17 \x1f \n \" \\<endfold id='3'>"""</endfold id='3'>

# Decimal, Hex, Binary, Octal
a = 1_2_34L
b = 0_0_00_0
c = 0xA_3f_43D
d = 0b0_0_1_01
e = 0o71_2_34
# Float
d = 1.1E+3
e = 1.E+3
f = .1E+3
g = 1E+3
h = 1.1
i = 1.
j = .1
k =  1
l = 1_0.e+3_22 + .2_1e2 + 11_1.
# Complex
m = 1.1E+3j
n = 1.E+3j
o = .1E+3j
p = 1E+3j
q = 1.1j
r = 1.j
s = .1j
t =  1j
u = 1_0.e+3_22j + .2_1e2j + 11_1.j

# Invalid numbers
aaa.123
aaa123
.0x123

# match and case keywords
</indentfold>foo<beginfold id='2'>(</beginfold id='2'>
    # no keyword
    match if xx else yyy
<indentfold><endfold id='2'>)</endfold id='2'>
match = 3
match.foo<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>
match command.split<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>:
    case <beginfold id='5'>[</beginfold id='5'>"quit"<endfold id='5'>]</endfold id='5'>:
        print<beginfold id='2'>(</beginfold id='2'>"Goodbye!"<endfold id='2'>)</endfold id='2'>

match<beginfold id='2'>(</beginfold id='2'>command.split<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'><endfold id='2'>)</endfold id='2'>
match<beginfold id='2'>(</beginfold id='2'>command.split<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'><endfold id='2'>)</endfold id='2'>:
    case <beginfold id='5'>[</beginfold id='5'>"quit"<endfold id='5'>]</endfold id='5'>:
        print<beginfold id='2'>(</beginfold id='2'>"Goodbye!"<endfold id='2'>)</endfold id='2'>

def func1<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>:
    yield 1
    yield  from <beginfold id='5'>[</beginfold id='5'>func<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>, 1, 2, "3"<endfold id='5'>]</endfold id='5'>
    # invalid, "from" no longer part of "yield from"
    yield, from 1

async def func2<beginfold id='2'>(</beginfold id='2'><endfold id='2'>)</endfold id='2'>:
    await asyncio.sleep<beginfold id='2'>(</beginfold id='2'>1<endfold id='2'>)</endfold id='2'>

assert cond, \
    "bla bla"

print<beginfold id='2'>(</beginfold id='2'>'dsdsa' \
</indentfold>      'dsdasw'
<indentfold>      'dsadsa'<endfold id='2'>)</endfold id='2'>

"\\\\\\\\\\ENSURE THAT THIS AND THE FOLLOWING LINES ARE AT THE <endfold id='7'>END</endfold id='7'> OF THE FILE\\\\\\\\\\ \
"
</indentfold>a = 'otherwise the next line will be
<indentfold>stuck on the Error attribute'
BR"Strings delimited by single quotes (' or ")
can NOT be defined across multiple lines
unless escaped with \
</indentfold>"
