Berto2002 Posted January 24, 2022 Posted January 24, 2022 Hi everyone. Regex is a mystery code with magical properties! But too magical for non-coders :-) I have emails coming in from an upstream system which I'm picking-up with routing rules and feeding into workflow. I use this Regex to extract the email address of the user from the Summary and it works fine: (?<=\()(.*?)(?=\)) I then trawled the 'net and came-up with this Regex to extract the contents that follow the "Name:" string: (^Name:\s*\K[^:].*) But it doesn't work, despite looking like it should in the tester. When I paste the result to the Timeline I get null/blank. This is the email when we look at Email Source:
Victor Posted January 24, 2022 Posted January 24, 2022 @Berto2002 assuming you are using Regex Substring from Utilities, try this: ((?<=Name:\s).*) Don't ask details, I have none, every time I am looking at REGEX it feels like I have no idea what I am doing. But this is the result with the above output into timeline: 1
Frank Reay Posted January 24, 2022 Posted January 24, 2022 @Victor you crack me up Victor!!!! I am clearly not alone in this universe when looking at Regex! 1 1
Guest Paul Alexander Posted January 25, 2022 Posted January 25, 2022 @Berto2002 Have you tried the 'string utilities' options in the BPM nodes for this instead of regex? We use it to find users names in our automated leavers requests. We do a search for a 'known' string 'like "Name:" for instance and then use the Substring node to extract the info. Gotta be easier than regex!!
Berto2002 Posted January 25, 2022 Author Posted January 25, 2022 Great folks, I have two super suggestions to help! Thank you. I am glad we also all find Regex a mystery lol
Berto2002 Posted January 25, 2022 Author Posted January 25, 2022 I went with Victor's Regex and it works. Spread the word about Victor being a genius with Regex :-) @Paul, your suggestion is in the toolbox for another time. Useful to be about to count to the start of a string and then use that later for something. 1
Victor Posted January 25, 2022 Posted January 25, 2022 @Berto2002 8 minutes ago, Berto2002 said: Victor being a genius with Regex It wasn't me really... 3
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now