0

I am new to JavaScript, so this might be naive. Why does

/sel\(linux\)\:.*/gi.test("sel(linux): foo")

matches, but

new RegExp("sel\(linux\)\:.*", "gi").test("sel(linux): foo")

does not?

Tom de Geus
  • 5,023
  • 2
  • 28
  • 62

0 Answers0