Dear comunity,
I have field like this:
abc xyz email@email.fr
fre gyu fff emailemil@email.com
What i expect is this
abc xyz | email@email.fr |
abc | email.emil@email.com |
fre gyu fff | emailemil@email.com |
I really appreciate your help 🙂
Regards
Solved! Go to Solution.
Hi @messi007
Here is the config
(.*)\s([\w@\.]*)
Output:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Another solution
(.*) (.*)
Your approaches are mind blowing. But i dont understand how its working.
For the 3rd string
why is not splitting as
fre | gyu fff email.emil@email.com
Hi @atcodedog05
Thanks 🙂 One day I'll write a blog or two...
Regex is by default greedy. The expression finds a) the first match and b) the longest possible match. Also, it's the first (.*) that takes precedence over the second.
So (.*) will capture everything.
And (.*)\s will capture everything up until the last space.
And (.*)\s(.*) will capture everything up until the last space and after the last space.
To split as you describe, make the first expression non-greedy with a question mark,
(.*?) (.*)
Dunno if any of that makes sense?