I am able to build the regex just fine on websites like regex101.com but not getting any matches within studio.
Code: (?<=Delito Pena Principal Pena\s\s\d ).+
Tried both .matches() and Matches activity.
I know some regex just dont “transfer correctly”, like how I need to use \s instead of \n for newlines in studio. From looking online there seems to be plenty of people with similar issues since 2020.
How can I solve this?
Isn’t there a resource from UiPath explaining this?
Hi @rpadev77 ,
Maybe you could check with the below Regex :
(?<=Delito Pena Principal Pena\s+\d\s).+
Great that worked.
Can you explain the disconnect? Was UiPath automatically removing a line?
Noticed you have used
\s\s - This accounts for two spaces only, whereas we have a newline (2) present in the data.
The newline can also be replicated by
\s+ - One or more number of spaces, Hence the replacement.
However, Even with your regex, I was able to get the output. Could you let us know what was the configuration in
Matches Activity if you have used it ? Was it done like below :
Was the Multiline option selected ?
Ah no I didnt have the Multiline option. I saw the 2 lines when pasting the output but not in the output itself. I’ll uttilize the properties panel or regex.matches.() instead of the Config Wizard here on out.
I cant seem to get \n to recognize newlines in UiPath and have been using /s as a workaround. I see how /s**+** quantifier was need since \s is for spaces.
Would you recommend a better way to identify newlines in studio (\n doesnt seem to work and I dont have a specific use case atm) or stick to \s+
It is sometimes a carriage return as well, so we use options -
\s for spaces
\n for newlines
\r for carridge returns
with a combination of quantifiers:
? zero or one
Thank you for the help.
(“plus sign”) as many as possible
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.