Excel: How to extract data using Regex and paste the results to a different column?


I would like to extract the data that is in parentheses from the “OFS” column and paste it into the “PT” column.


Expected Results:


I tested the Regex pattern and it works as expected:


However, this is the result I’m getting:


This is what I have so far:

RegexTest.zip (42.7 KB)

Any help would be greatly appreciated! :pray: :slight_smile:

Have a look on following regex:

Change the flow like:

  • add data column PT if it is not already present

  • inside the for each row block do following

row("PT") = System.Text.RegularExpressions.Regex.Match(row("OFS").toString,"(?<=\().*(?=\))").toString

After the for each row write updated data back to Excel

1 Like

Thank you! It works! :grinning_face_with_smiling_eyes:

RegexTest.zip (42.0 KB)

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