// string replacements
 a a
b a a
aaa
xa a a
// regex
  x
x  
  x  
123x123
x  x
xx
// empty regex
xaxaxax
// lastIndex should not be modified
xxxx
1
// $ with non-special successor char
a$kaa
// $& 
a|b|aa
// $` 
axaxfg
// $' 
axfgfg
// $1
a<b>c
// capture group 0 not recognized
a<$0>c
// capture group 00 not recognized
a<$00>c
// leading 0 capture group number
a<b1>c
// not enough groups
a<$2>c
// two-digit capture group number, but not enough groups
a<$20>c
// two-digit capture group number, but not enough groups with prefix as a valid group
a<b0>c
// Two-digit capture group number
<b>#bbc
// replace function
foobbbb
// replace with functions returning non-string values
2bbbb
undefinedbbbb
// replace a regex with function, check arguments
<<a,a,,,2,<<a>>>>
<<a,2,<<a>>>>
// regex calling into itself
this is complicated, really complicated.
