jashkenas--coffeescript/test/test_regexp_interpolation.c...

18 lines
281 B
CoffeeScript
Raw Normal View History

name: 'Bob'
ok not not '"Bob"'.match(/^"${name}"$/i)
ok '"Bobby"'.match(/^"${name}"$/i) is null
ok not not 'Bob'.match(/^$name$/)
ok 'Bobby'.match(/^$name/)
ok 'Bobby'.match(/${"${"${"$name"}"}"}/imgy)
ok '$a$b$c'.match(/\$A\$B\$C/i)
a: 1
b: 2
c: 3
ok '123'.match(/$a$b$c/i)