Namespace
The input string.
The regular expression pattern to match substrings.
An array containing all substrings that match the pattern.
const originalString = "The quick brown fox jumps over the lazy dog";
const pattern = /[aeiou]{2}/g; // Match two consecutive vowels
const matchedSubstrings = extractSubstringsByPattern(originalString, pattern);
console.log(matchedSubstrings);
// Output: ["ui", "ow", "um", "ps", "eo", "er", "az"]
Generated using TypeDoc
StringUtils
Extract all substrings from a string that match a given pattern.