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

Hi,

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

image

Expected Results:

image

I tested the Regex pattern and it works as expected:

image

However, this is the result I’m getting:

image

This is what I have so far:

RegexTest.zip (42.7 KB)

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

@Tana20
Have a look on following regex:
grafik

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.