Regex - How to work with IEnumerable type

Hello There,

I was exploring Regex and saved the match in a variable. (a mobile number in this case). The variable seems to be a collection type (IEnumerable). Any idea how I can get the match/es from this variable? the ToString method didn’t seem to work here


Hi There,

You can use the below code in assign and the convert it to string.
I believe you will be using Find Match function.

Use assign variable

String variable name = XPR_PDF_Total(0).Result(“$1”).Trim.Split(" "c)(0)

In above XPR_PDF_Total is the IEnumerable collection result
$1 is the Group you are trying to load
Split is used if your group have multiple data values separated by space(" ") character

Hope this helps.