I want to find paths from a string and remove them e.g. string1 = "'c:\a\b\c'!MyUDF(param1, param2,..) + 'c:\a\b\c'!MyUDF(param3, param4,..)..."
, I'd like a regex to find the pattern '[some path]'!MyUDF
, and remove '[path]'. Thanks
Edit e.g. input string1 ="'c:\a\b\c'!MyUDF(param1, param2,..) + 'c:\a\b\c'!MyUDF(param3, param4,..)"; expected output "MyUDF(param1, param2,...) + MyUDF(param3, param4,...)" where MyUDF is a function name, so it consists of only letters
input=Regex.Replace(input,"'[^']+'(?=!MyUDF)","");
In case if the path is followed by ! and some other word you can use
input=Regex.Replace(input,@"'[^']+'(?=!\w+)","");
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments