JS regex and angle brackets

Posted by chaz on Stack Overflow See other posts from Stack Overflow or by chaz
Published on 2010-06-12T04:02:26Z Indexed on 2010/06/12 4:12 UTC
Read the original article Hit count: 333

Filed under:
|

Seriously, why can't I parse a string with angle brackets using the Javascript regular expression object?

var r = new RegExp(), r;
r.compile("\\<div\\>", "g");
r = r.exec("<div>Hello</div>"); //Equals null yo

Why does that not work?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex