Answers for "regex 'wildcard' placeholder"

0

regex 'wildcard' placeholder

// To match "cat", "BAT", "fAT", "mat"
const regexWithWildcard = /.at/gi;
const testString = "cat BAT cupcake fAT mat dog";
const allMatchingWords = testString.match(regexWithWildcard); // ["cat", "BAT", "fAT", "mat"]
Posted by: Guest on July-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language