regex - JavaScript Regular Expression Syntax -


I'm trying to create a regular expression that checks the letters, numbers, and underscores in .NET, ^ \ W + $ "I can. However, I'm not familiar with javascript syntax. Can somebody help me out?

Thank you!

One obvious difference is that in javascript, you can regex the form of the / pattern / flags - This is Perl-style, your "example" will then be ^ \ w + $ / ^ \ w + $ / .

For example, a e with multiple e , case-insensitive search (hence i flag): < / P>

  var s = 'qweeeerty'; S = s.replace (/E + / I, 'E');   

Returns: qwerty .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -