使用正则表达式查找和替换字符串 [英] Find and replace a string using regular expressions

查看:108
本文介绍了使用正则表达式查找和替换字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我需要使用正则表达式在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 ''
Replace ntext\(\d+\) with TEXT

Replace DEFAULT\(\((\d+)\)\) with DEFAULT ''


1''
1''


这篇关于使用正则表达式查找和替换字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆