Regex Expression not working in UiPath

…(?s)(?<=Something).?[\n\t].?^[\n\t]
…(?s)(?<=Source).?[\n\t].?^[\n\t]
…(?s)(?<=Source).?^[\t]$
the above expression is working fine in Regex101.com but doesn’t work in UiPath?

Hi @Mohan_R,

As far as I know, the https://regex101.com/ is not the best option to be used with UiPath.
(Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. )
That site does not have the specific regex for .net language.

From my side, I was using both of these sites:


http://regexstorm.net/tester

I hope it helps.

Vasile.

Hi @wasea

CAn you show the text you wAnt to extrAct

ThAnks
Ashwin S

Hello Ashwin,

I need to extract below text in “Bold”.

Account Analys

SourceC Category Batch Name JE Name Account Description Entry Item Debits (INR) Credits (INR)
---------- ---------- ------------------------------ --------- ------------------------------------------ ----------- ----------------- --------------------- ---------------------
Payables Reconciled Payables A 18348233223 34517622222056 ﻮﻴﻧﻮﻳ-19 11-01-00000-00000-12205-0000-000000-0000-0 CartJournal Import Cr 98.77
Payables Reconciled Payables A 18348232323 3451762222056 ﻮﻴﻧﻮﻳ-19 11-01-00000-00000-12205-0000-000000-0000-0 238703 Journal Import Cr 210.00
Payables Reconciled Payables A 18348233223 34517622222056 ﻮﻴﻧﻮﻳ-19 11-01-00000-00000-12205-0000-000000-0000-0 CartJournal Import Cr 98.77
Payables Reconciled Payables A 18348232323 3451762222056 ﻮﻴﻧﻮﻳ-19 11-01-00000-00000-12205-0000-000000-0000-0 238703 Journal Import Cr 210.00
Payables Reconciled Payables A 18348233223 34517622222056 ﻮﻴﻧﻮﻳ-19 11-01-00000-00000-12205-0000-000000-0000-0 CartJournal Import Cr 98.77
Payables Reconciled Payables A 18348232323 3451762222056 ﻮﻴﻧﻮﻳ-19 11-01-00000-00000-12205-0000-000000-0000-0 238703 Journal Import Cr 210.00

ﺔﻳﺩﻮﻌﺴﻟﺍ ﺕﻻﺎﺼﺗﻻﺍ ﺔﻛﺮﺷ Account Analysis Report

Hi @wasea

Use this

(?=SourceC).+(?<=import cr 210.00)

Thanks
Ashwin.S

@AshwinS2 “(?=SourceC). +(?<=import cr 210.00)” is not working
I need below output in http://regexstorm.net/tester

Thanks & Regards
Mohan

hi @Mohan_R

use String.remove("----","") and then try to extract the text using regex

Thanks
Ashwin S

@AshwinS2,

Thanks for the help,
Below is the solution for the above problem.

…(?s)(?<=Source).?(?s)(?=Account Analysis Report|Total for Period).?

Thanks & Regards
Mohan

1 Like

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