请用正则表达式帮助我 [英] please help me with the Regular expression

查看:98
本文介绍了请用正则表达式帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用正则表达式如何将字符(字母)更改为#"

123456789please987654321help12345me123
123456789 ###### 987654321 #### 12345 ## 123-result

using regular expression how do i change characters(letters) into "#"

123456789please987654321help12345me123
123456789######987654321####12345##123 - result

推荐答案

Try:
Regex regex = new Regex("[a-zA-Z]");
string result = regex.Replace(InputText,"#");



获取 Expresso [ ^ ]-它是免费的,它可以检查并生成正则表达式.



Get a copy of Expresso [^] - it''s free, and it examines and generates Regular expressions.


我希望这可以解决您的问题

http://lawrence.ecorp.net/inet/samples/regexp-format.php [ ^ ]

http://www.funduc.com/regexp.htm [
I hope this will Solve ur problem

http://lawrence.ecorp.net/inet/samples/regexp-format.php[^]

http://www.funduc.com/regexp.htm[^]


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

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