pattern: test string:

pattern.test(testString) testing Test pattern for a match in testString. Return true if found, otherwise return false.

pattern.exec(testString) abdcdef Test pattern for a match in testString. Return the matched text if found, otherwise return null.

testString.match(pattern) ttttesting Search testString for a match against pattern. Return matches as an array.

testString.search(pattern) testinggg Search testString for pattern, return position of match. 'pattern' can be String or RegExp



Regular expressions

See one of several descriptions on the Web.

Test out some regular expression patterns

Now see some more complicated examples HERE