javascript-today

Regular Expressions II

Regular Expression Methods

exec (regex method) - executes a search for a match in a string, returning an array or null if not found.

test (regex method) - search for a match and return boolen of true or false.

match (string method) - search for a match in the string and returns array or null if not found.

search (string method) - tests for a match in a string and returns the index of the match or -1 if not found.

replace (string method) - search for match then replaces match.

split (string method) - returns an array of substring as defined by the regex matches.

Next Article: Async code