正则表达式问题.... [英] Regular Expression Problem....

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

问题描述

HI专家,



我正在用C#做一个Windows应用程序,而且我陷入了验证过程。

我想要检查文本框中的值是否为数字。但有一个条件不仅是数字而且还支持+符号....



这里我用ahev使用Regx方法......这是下面的示例代码...



 Regex.IsMatch(txt_Country_Code.Text.Trim(),  ^ [0-9] + $





但现在它只支持数字..我需要,它包括数字也支持+符号..





Plz帮我解决了这个问题..





Thnaks



Dileep

解决方案





但是现在它只支持数字..我需要,它包括数字也支持+符号..





Plz帮助我来解决这个问题..





Thnaks



Dileep


^ \\ +?[0-9] +





http://msdn.microsoft.com/en-us/library/az24scfc.aspx [ ^ ]



我们这里有一个Regular Expessions论坛。

HI Experts,

I am Doing a Windows application in C#, And i am stuck in a validation process.
I want to check the value in a text box is numeric or not. But one condition is Not only the numeric but also it supports "+" sign....

Here i ahev used the Regx method... Here is the below sample code...

Regex.IsMatch(txt_Country_Code.Text.Trim(), "^[0-9]+$")



But now it supports only the numbers.. i need , it include the numeric also it suport "+" sign..


Plz help me to solve this problem..


Thnaks

Dileep

解决方案

")



But now it supports only the numbers.. i need , it include the numeric also it suport "+" sign..


Plz help me to solve this problem..


Thnaks

Dileep


"^\\+?[0-9]+


"

http://msdn.microsoft.com/en-us/library/az24scfc.aspx[^]

And we have a Regular Expessions forum here.


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

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