Sneak Peek/Live Creation - New Tasker Action! (Patreon)
Content
This week I'm giving you a mix of live creations and sneak peek with the new Simple Match/Regex action!
Try the new action right now with this special Patreon exclusive version
This action allows you to use a simple matching pattern to match some text and get some info out of it!
For example, if you have some text like His name is Jack and he's 20 years old, you could use a simple pattern like name is $name and he's #age years old. This would create %name and %age variables in your task that would have the values Jack and 20 respectively.
So, to match numbers you use #var_name and to match anything else you use $var_name!
This should hopefully take care of a good percentage of situations where you want to extract some info from a piece of text.
BUT, if that's not good or precise enough, you can use Regex!
Simply create your regex and name your groups with (?<var_name>) and the variables will be created!
In the above example you could use the name is (?<name>.+) and he's (?<age>.+) years old regex for example, and it would create the same variables!
You can also use the variables as arrays if more than one match is found in the text.
Let me know what you think of the new action! 😊 Enjoy!