Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

54
Views
`"...".test("...")` matches but `RegExp("...").test("...")` does not

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?

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs