Monday, 15 September 2014

javascript - /regex/(string) considered harmful? -


In Javascript you can match regular expression with regx syntax.

However the syntax is not 'as far as I know, nobody knows why?

A regular expression on some browsers, if so where a function, regexp (str) / Code> Method is equivalent to calling.

This is not recommended as the syntax is part of not , version 3 specification, and is not guaranteed to work:

  var result1 = Regexp.exec (str); // part / 2 results of ECMA-262 var = regexp (str);  

No comments:

Post a Comment