Archive for the ‘regexp’ Category

Working With Regular Expressions in JavaScript

Defining Regular Expression Patterns:
The most common way to define a regexp pattern is to define a variable instance with a pattern you want to match, along with any modifiers you wish to use. This can be achieved with the following:

1
var pattern = new RegExp("yourpattern", ["g"|"gi"|"i"|"x"]);

Understand that the second parameter is just an example, and not [...]