具有超过4位数的数字的正则表达式 [英] Regex expression for numbers having more than 4 digit

查看:1447
本文介绍了具有超过4位数的数字的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我在项目中使用正则表达式来提取电话号码..

现在,我正在使用像这样的表达式..



Hi friends,

I am using regex expressions in my project to extract the phone numbers..
Now, I am using an expression like this ..

var exp = new Regex(@"#?[0-9\s\-\(\)]{4,20}", RegexOptions.IgnoreCase);





我是什么想要的是得到超过4位的数字。

但它计算表达式中的所有内容...例如:它返回(20)这也是....

如果数字超过4位数我该如何选择,如果包含这个特殊字符,请选择其余数字...



对不起我的英文...



What I want is to get the numbers having more than 4 digits.
But its counting everything in the expression... For eg: It returns (20) and this too....
How can I choose only if the numbers are more than 4 digits, and select the rest if it contains this special characters...

Sorry for my english...

推荐答案

我想你在学习时会很清楚Regular_expression [ ^ ]你仍然会得到一个清晰的新想法。你对这个特定主题有更多的疑问,最好提一下,如果你已经完全审阅了,那就很抱歉。如果我知道我会尽快发布。
I think you will be clear when you study this Regular_expression[^] you will still get a clear and new idea. You have more questions on this particular topic is better to refer that and sorry if you already refereed it completely .If i get any idea i will post it soon.


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

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