June 20, 2017, 2:22pm
Hi i´m trying to wrap my head around RegEx for finding mail adresses in huge blocks of texts. But I´m not able to find a functional RegEX to copy from
regex101.com. And when i did find one, it worked, but only saves one email adress. not multiple..
Any help is greatly appreciated!
Put the RegEx in a
For Each action (KM Wiki), and add the For Each variable to another collection variable.
Similar to this:
June 21, 2017, 12:02pm
I´m getting closer, but whats the function for the first action "Set Variable to text" Do I keep it empty?
Still not getting the results i want here..
Uploading my macro and sample text, containing two mail adresses that should be captured here.
I would like my macro to capture the email adresses firstname.lastname@example.org, and email@example.com, but not get anything else out. ""
Search for email adresses.kmmacros (3.9 KB)
June 21, 2017, 5:19pm
If you use a regex in a For…Each action than it is always case sensitive. Hence, the
A-Z character range will only get uppercase letters. You have to add
Search for email adresses [mod].kmmacros (3.4 KB)
It is to reset the FEW_Results variable. Otherwise the variable would accumulate the results with every macro run. So, leave it empty, yes.
You can disable the action to see what I mean.
That is the
default, which can be overridden by using the
option at the beginning of the expression, as in:
For more info about this and other RegEx options,
see Regular Expressions (KM Wiki).
Also, you may want to review the email RegEx patterns here:
Email Address Regular Expression That 99.99% Works.
June 22, 2017, 8:27am
@Tom and @JMichaelTX!