Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

string match

//The match() method searches a string for a match against a regular expression, and returns the matches, as an Array object.

// ex : Search a string for "ain":

let text = "The rain in SPAIN stays mainly in the plain";
text.match(/ain/g);

// >> ain,ain,ain

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #string #match
ADD COMMENT
Topic
Name
2+5 =