Using Regular Expressions for String Matching in Javascript


Perform complex string matching and replacements.

Source Code

let text = 'Visit W3Schools';
let result = text.replace(/W3Schools/, 'W3Docs');
console.log(result); // Visit W3Docs
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments