Help on DataTable output text complex regex

Regex help? I am a self-admitted, over-thinker and am lost on a regex for this:

Title:, branch office lease renewal - Testing,branch office lease renewal - Testing,
What type of spend request are you making?,Real Estate Lease,
Is project located at xx or xxx?,
RequestType:,New Request,New Request,
Total Cost in USD:,"$###### USD",
Business Entity:,Location,
Total Cost in Local Currency:,"####### CNY",

This is an output data table string. I need to capture “Real Estate Lease” from the row "What type of spend request are you making?, and I need to capture Request Type of New Request and I need to capture Business Entity


,-+[,-] us whatI have gotten to but do not know how to filter down through the carriage returns to new lines and to extract after the specific text

This is one of those situations where I would back up and ask “how can we improve the format of the data?”

Where is this coming from? It looks like some sort of form is being filled in and then that text is being generated. If that’s true, you should look at modifying the form/web page or wherever it’s coming from so that it provides a better data format.

Do you need to extract them in separate variables or in one string form? If you want in one string then this might help

((?<=making\?,)\w+)|(?<=RequestType:,)[\w\ ]+(?=,)|(?<=Entity:,)\w+

I tried something similar to this but still have some errors…I do need separate variables but I am not capturing phrases such as Real Estate Lease - only capturing Real. Or on Business entity if it is United States or United Kingdom, I am only capturing United

Okay. Try This inside matches activity and you will get 3 matches.

((?<=making\?,)[\w ]+)(?=,)|(?<=RequestType:,)[\w\ ]+(?=,)|(?<=Entity:,)[\w ]+(?=,)

That seems to work if I split the regex at | and change the leading comma from , to ,…thank you

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