Text - Regex_Replace for xml prefix replace is not working calling from espace

Text - Regex_Replace for xml prefix replace is not working calling from espace

  
Hi,
I am trying to use  Regex_Replace of Text extension for replacing namespace and prefixes in the xml string from an espace. Below are the inputs given to the method to replace prefixes and it is not working. The returned xml has prefixes.

Pattern: "(<)(\\w+:)(.*?>)"
Replace:  "$1$3"
IgnoreCase: True

If I open the extension and do the same using main method, it is working properly. But if i use it from an espace action it is not working.
Appreciate your help

Thanks,
Thiru