Where does it go wrong?
This is what i try to get: Tel.: +123 2 321 222 11
I tried Matches activity too:
Where does it go wrong?
This is what i try to get: Tel.: +123 2 321 222 11
I tried Matches activity too:
Hi @Ibra
I it works on the regex101.com, then try removing the marks for start of line and end of line ^ and $.
(\+(\d){3} (\d){1} (\d){3} (\d){3} (\d){2})
@Ibra In text.ToString() remove.ToString() and check
Nothing worked guys
What i also tried was removing my For Each and placing a writeline only. I changed the pattern to “t” (a single character) and it did print out. Next i tried was only changing the pattern again (the “t”) to:
Bbut then i get this in my output panel:
System.Linq.Enumerable+d__97`1
[System.Text.RegularExpressions.Match]
EDIT: I debugged and the Matches activity was still empty when executed.
Correct regex would look like this, please try:
\+\d{3} \d{1} \d{3} \d{3} \d{2}
No need to use parentheses for every digit group unless you want to catch them separately
Thank you! It worked!
But i have few questions before you leave my topic, please
E.g.: Tel.: +123 2 123 123
Mob.: +321 3 321 321
Thank you.
Tel\.: \+\d{3} \d{1} \d{3} \d{3} \d{2}
This answers your second question too - some characters are part of regex syntax and need to be escaped with a backwards slash \
As you can see above, I escaped the dot in Tel.
and the plus sign +
It might be that the : character will also need an escape, but I’m not sure
The general idea to regex is that you can type in your sentence as is or use a mix of stable parts and variable ones. In this case, you want to “hardcore” your "Tel.: ", but make the digits variable
I tried this in regex101 but it also fetching “Tel.:” along with the digits. How do u remove it?
I see, my bad for misunderstanding that you want only the digits
See below link for the solution:
regex101: build, test, and debug regex
Thank you!