Cannot split the word set between 2 word sets

I use this regex expression :
(?<=Date of application (DD/MM/YYYY)+\n+\n)(.|\s)*?(?=Dealer name)
to split the “Mackay Isuzu” out as below picture

and the UI path shows the word below

as you can see the first write line function can run properly with almost the same regex expression code (?<=G-IDSS Serial Number )(.|\s)*?(?=\nAcknowledgement)

Could you please help me, I cannot find the same topic as I met the issue on the internet, many thanks

Hi,

It might be line break matter. Can you try the following pattern.

(?<=Date of application \(DD/MM/YYYY\)+(\r?\n)+\r?\n)(.|\s)*?(?=Dealer name)

Regards,

Hello @poomnattawat Welcome you to Uipath Community
Kindly try this
(?<=Date of application \(DD\/MM\/YYYY\)\n\n).*(?=\nDealer Name)

System.Text.RegularExpression.Regex.Match(YpurString,"(?<=Date of application \(DD\/MM\/YYYY\)\n\n).*(?=\nDealer Name)").Tostring.Trim

image

1 Like

Oh It works well, I can print out the Dealer name, but I found another issue again as below

image

In upper picture, it’s showing the same error, how I can fix this one of the line brake matters, could you please roughtly explain about the rule of the line brake please.

Regards

1 Like

Many thanks for your guidance :grinning:
I will try your code also :smiling_face_with_three_hearts:

Hi,

There are some types of linebreak in each environment.
Unix style : \n (text in regex101)
Windows style : \r\n

So if we need to handle both type of linebreak, I recommend to use \r?\n instead of \n. ( or (\r?\n) if quantifier exists after it) as linebreak.
The above expression might be better like

(?<=modification \.\r?\n)(.|\s)*?(?=\*If you do not know)

Regards,

1 Like

Hi

Goodday,

Thanks a lot for your suggestion,It makes me continue my progress properly :smiling_face:

Regards

Hello

I used your recommend codes and it showed as below

image

message": "\r\n

What does it mean, I check on the website It still collects the true data.

image

Regards

Hi,

Can you share your input text as a file, if possible?

Regards,

Hi,

Please see the attached file below,

LSSdata.txt (1.9 KB)

Regards

Hi,

The above expression works in my environment as the following. Can you check the following sample?

Sample20220909-3.zip (3.3 KB)

Regards,

1 Like

Hi,

Thank you for your example files, In this case, I still struggle in my head with why I use your expression in the matches function, the UI path cannot run properly, but using the Assign function It can work well.

Anyway, I would like to say thank you again for your advice :+1: :+1: :+1:

Best regards

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.