You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: String methods/script.js
+86-1Lines changed: 86 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,92 @@
182
182
// // groups: undefined
183
183
// // ]
184
184
185
-
// console.log(text.match(/ain/)); // sme result as "search()" method
185
+
// console.log(text.match(/ain/)); // same result as "search()" method
186
186
// console.log(text.match(/ain/g));//it returns how many "comparestring" available inside of string
187
187
// console.log(text.match(/ain/gi));//it returns how many "comparestring" available inside of string but both cases lowerCase and UpperCase
188
188
// console.log(text.match(/w/));// if method failed it returns "null"
189
+
190
+
191
+
// MATCHALL() METHOD //
192
+
193
+
// SYNTAXES //
194
+
//string.matchAll()
195
+
// let text = 'The rain in SPAIN stays mainly in the plain';
196
+
// // let s = text.matchAll('ain')//it returns all matched strings inside referenceString and their position all stuff
197
+
// // console.log(...s);
198
+
// // let a = text.matchAll(/ain/g)////it returns all matched strings inside referenceString and their position all stuff
199
+
// // console.log(...a);
200
+
// let b = text.matchAll(/ain/gi)////it returns all matched strings inside referenceString and their position all stuff but both cases lowercase and upperCase
201
+
// console.log(...b);
202
+
// let e = text.matchAll(/w/gi)//if method failed it returns empty array [];
0 commit comments