I have tried the StringReplacer but I'm struggling to remove everything I need to, without also removing part or all of the email as well. Any help would be appreciated, thank you.
I am trying to extract just the email address from a string of text, for example: Joe Blogs | Senior Advisor | Joe.bloggs@example.co.uk | pointOfContact
Hi @clare42 ,
Try this regex with the StringSearcher transformer.
[\w.+]+@[\w+\.\w.]+
The output should be: Joe.bloggs@example.co.uk
Hi @clare42 ,
Try this regex with the StringSearcher transformer.
[\w.+]+@[\w+\.\w.]+
The output should be: Joe.bloggs@example.co.uk
Hi, thank you. It works much better, but it seems to cut the end bit off, so I end up with Joe.Bloggs@example
Hi @clare42 ,
Try this regex with the StringSearcher transformer.
[\w.+]+@[\w+\.\w.]+
The output should be: Joe.bloggs@example.co.uk
Nice!
Hi, thank you. It works much better, but it seems to cut the end bit off, so I end up with Joe.Bloggs@example
Hi @clare42 . My regular expression knowledge isn't the best, so you might want to use this regular expression that should be a safer bet in capturing email addresses.
Source: https://emailregex.com/
Regex:
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
In my testing it does in fact capture the email address you provided in your example.
Hi, thank you. It works much better, but it seems to cut the end bit off, so I end up with Joe.Bloggs@example
Thank you 😊
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.