I am looking for an approach to the following problem. It captures all *
values from the string using a provided pattern.
function capture(pattern, string) {
}
Example:
Input
Pattern
The quick brown * jumps over the lazy *
String
The quick brown fox jumps over the lazy dog
Output [fox, dog]
Is it possible to solve it using regex?