Using the RegExp (regular expression) object and it's associated methods allows you to perform powerful pattern-matching searches within strings.
Constructor
Instance Methods
exec
|
Searches a string for a specified value and returns the found value(s) and position.
|
test
|
Returns a true or a null after performing a search for a specified value.
|
|
Example
var pattern= new RegExp('is','ig');
response.write(pattern.exec('Is this all there iS?\n or IS there more?'), '\n');
response.write(pattern.exec('Is this all there iS?\n or IS there more?'), '\n');
response.write(pattern.exec('Is this all there iS?\n or IS there more?'), '\n');
response.write(pattern.exec('Is this all there iS?\n or IS there more?'), '\n');
//output:
//Is
//is
//iS
//IS
Related Topics
RegExp Patterns
,
RegExp Flags
,
RegExp.exec()
,
RegExp.test()
|