Javascript RegExp with a variable not working in IE

Posted by TenJack on Stack Overflow See other posts from Stack Overflow or by TenJack
Published on 2010-03-14T18:14:02Z Indexed on 2010/03/14 18:25 UTC
Read the original article Hit count: 335

I am having a problem getting a RegExp with a variable to work in IE. It works fine in firefox:

  wordChar = word[i]
  var expr = new RegExp(wordChar,"i")
  var hold = expr.test(input[i]) 

Not sure how to go about fixing this.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex