Filter Datatable row with Regex

Hi All,

I have done a data scrape and in one of the columns it contains 2 pieces of information
e.g. Date of Birth ( xx-xx-xxxx), Gender
I would like to know is it possible to regex that column in the datatable straight after a scrape or do I need to build a datatable, input the scraped data then regex the column?

Thank you in advance for any assistance

Hi @LB34

U can try like this

dt.AsEnumerable().Where(Function (row) row(“Date of Birth”).ToString.Equals(System.Text.RegularExpressions.Regex.Match(row(“Date of Birth”).ToString, regex pattern) And System.Text.RegularExpressions.Regex.Match(row(“Gender”).ToString, regex pattern)). CopyToDataTable

Try this way

Let’s see whether it works

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

1 Like

Hi Nived, could you provide a little more context on how we can use this within an assign. I’m interested in running this but I either return an input failure or it does nothing at all