使用正则表达式查找和替换字符串 [英] Find and replace a string using regular expressions
本文介绍了使用正则表达式查找和替换字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们,
我需要使用正则表达式在C#中更改以下字符串.
1)ntext(1073741823)
简化为TEXT
2)从DEFAULT((0))
到DEFAULT ''0''
请使用正则表达式帮助我.
问候,
sarva
Hi friends,
I need to change the following strings in C# using regular expressions.
1) ntext(1073741823)
to simply TEXT
2) DEFAULT((0))
to DEFAULT ''0''
Please help me with the regular expressions.
Regards,
sarva
推荐答案
将ntext\(\d+\)
替换为TEXT
将DEFAULT\(\((\d+)\)\)
替换为DEFAULT ''
Replacentext\(\d+\)
withTEXT
ReplaceDEFAULT\(\((\d+)\)\)
withDEFAULT ''
1''
1''
这篇关于使用正则表达式查找和替换字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文