Thank you Keith_A_Lewis . Will wait for the fix. I have already been using re (not regex) library which presently serves the purpose. In fact this is how I have linked excel to that library with xlwings add-in as bridge (By defining Python script with UDF which is called directly from excel):
import xlwings as xw
import re
@xw.func
@xw.arg('excel_range', ndim=2)
@xw.arg('patterns', ndim=1)
def REGEXFINDM(excel_range, patterns):
result = []
for row in excel_range:
row_result = []
for cell in row:
cell_str = str(cell) # Convert cell to string
cell_result = []
for pattern in patterns:
match = re.search(pattern, cell_str)
if match:
cell_result.append(cell_str) # Return the entire string
if len(cell_result) == len(patterns):
row_result.append(" ".join(cell_result))
else:
row_result.append("")
result.append(row_result)
return result
(I have not properly formatted output above [directly copy pasted from my gvim syntax enabled .py file] with indents which Python is most fussy about) I believe that regex, as you have mentioned extends functionalities and is backward compatible with re but did not find need to get there till now.