How do I combine a regular expression function in vlookup?
16:42 09 Oct 2013

I have a VBA regular expression which I would like to combine with VLOOKUP however it does not return the value based on the regular expression if used with VLOOKUP.

This is what it returns when I execution the function =udfRegEx(A2,B2)

String

Microsoft Windows Server 2003, Standard Edition (64-bit)

Regular expression

^([^,]*)

Result

Microsoft Windows Server 2003

However when I execute =IFERROR(VLOOKUP(udfRegEx(A2,RegularExpression!B2),[Sample.xls]Sheet1!$B$2:$E$4177,4,FALSE),0) it still returns Microsoft Windows Server 2003, Standard Edition (64-bit)

Column B2 is the regular expression ^([^,]*)

regex excel excel-2007