/[]]/
    ]
 0: ]
    a
No match

/[]a-z]+/
    a]z
 0: a]z
    abcD
 0: abc
    ABC
No match

/^[^]a]+$/
    bbb
 0: bbb
    bab
No match
    b]b
No match

/./
    a
 0: a
    \n
No match

/./s
    a
 0: a
    \n
 0: \n

/a()b/

/a()+b/

/a(#blah)b/

