How can I extract these 6 items from a body of a text into mappable fields?

Hello @dom_1,
It was tricky.

I can’t tell you what the funny issue is. :slight_smile:
It was a different single quote (') used in the text I’m Enquiring About
See the single quote (') difference between I’m Enquiring About and I'm Enquiring About.

Now use this new updated RegExp.

Name:\s+(?<name>.*?)(\n|\\n)Email:\s+(?<email>.*?)(\n|\\n)Telephone:\s+(?<telephone>.*?)(\n|\\n)Country:\s+(?<country>.*?)(\n|\\n)I'm Enquiring About::\s+(?<enquiringAbout>.*?)(\n|\\n)Message:\s+(?<message>.*)

I’ve updated it slightly because I’ve noticed the possibility of the string coming with just \n without a line break.
Now it works with both of them. See the Proof regex101: build, test, and debug regex

I hope this time it works.
:+1:

3 Likes