I’m wondering if it’s possible to extract a number of variables from a predefined sentence with regex or similar.
e.g.
If this was the pattern…
"How many * awards did * win in *?"
And someone typed…
"How many gold awards did johnny win in 2008?"
How can I somehow return…
["gold","johnny","2008"]
I’d also like to return the fact that it matches the pattern before retrieving the variables as there will be many different patterns. Note: It will also be possible for someone to type multiple words in place of a * e.g. johnny english instead of just johnny
Thanks
Building on Derek’s answer and SimpleCoder’s comment, here would be the full function: