Regex in Filter Data Table Linq Query

Hi All,

Can anyone help me with the below query.

ExtractDataTable.AsEnumerable.Where$(Function(x) System.Text.RegularExpressions.Regex.Match(x(“List price (Quantity)”).ToString,“\d+.\d{2}\d*(?<=[1-9])|\d+.\d{2}”).Value AndAlso (x(“Charges”).ToString.Equals(sku_name)) AndAlso (x(“List price (Quantity)”).ToString.Equals(sku_listprice))).Count > 0 = true

HI,

How about the following?

ExtractDataTable.AsEnumerable.Where(Function(x) System.Text.RegularExpressions.Regex.Match(x("List price (Quantity)").ToString,"\d+.\d{2}\d*").Value.Equals(sku_listprice) AndAlso (x("Charges").ToString.Equals(sku_name))).Count > 0 = true

Regards,

2 Likes

@Yoichi

Thank You so much

1 Like

Hi @dutta.marina

Your expression should also work just the change being use ismatch instead of match while using regex for Boolean output

Thanks
Biswajeet

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