Testing for Pattern Matches : Introduction : Regular Expressions JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Regular Expressions » Introduction »

 

Testing for Pattern Matches








The pattern matching methods in the String object require RegExp objects.

Pattern Matching Methods in the String Object























Method Description
match(regExpObj) Searches for regExpObj pattern in string and returns result.
replace(reqExpObj,str) Replaces all occurrences of the regExpObj pattern with str.
search(reqExpObj) Returns the position of matching regExpObj pattern within the string.
split(regExpObj,max) Splits string everywhere there is a matching regExpObj pattern up to max splits. The substrings are returned in an array.








HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Regular Expressions
» Introduction