Hello, I’m trying to build a regex to get a number from a text, but I can’t figure out what to write, been doing test on Regex101 without any succes.
Here is the text:
No P.O. No com. cli. ASN No. No. référence Mode d’exp Terme d’ach.
111111 23232323 232323 2323232323 COLLECT NET 232323 JOURS
I need to get the ‘111111’ part, all thoses number are faked so I can show you the string here, so have in mind that all those series of number are actual number normally and not just ‘111’ or ‘2323’.
anyone that is more used to regex could help out with a solution?
@MaxyArthes \d can be used to match a digit 0-9, ^ can be used to match the start of a line.
If the “111111” starts at the beginning of a line you could use ^\d+ to grab “111111”.
^ - start of line
\d - digit
+ - 1 or more of the previous group (digits)
my bad, the part I showed is actually a part of a bigger text, that why I start by finding référence Mode d'exp Terme d'ach. and then the next serie of number. It’s just feel like something don’t work in the match activity but I can’t find what character would make it not working.
What I tried so far in regex101 that work and get me no result in UiPath:
(?<=\bréférence Mode d’exp Terme d’ach.\s)(\w+)
(?<=\bréférence Mode d.exp Terme d.ach.\s)(\w+)
@MaxyArthes
Make sure that the TypeArgument parameter of your For Each is System.Text.RegularExpressions.Match and then use itemtest.Value instead of itemtest.ToString.
still no result sadly. Copied back the txt file I create just before the ‘Matches’ into the regEx Builder and it’s does match so really, can’t find out what going on. Tried to restart UiPath also.