正则表达式问题....

编程入门 行业动态 更新时间:2024-10-25 16:21:52
本文介绍了正则表达式问题....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

HI专家, 我正在用C#做一个Windows应用程序,而且我陷入了验证过程。 我想要检查文本框中的值是否为数字。但有一个条件不仅是数字而且还支持+符号.... 这里我用ahev使用Regx方法......这是下面的示例代码...

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

但现在它只支持数字..我需要,它包括数字也支持+符号.. Plz帮我解决了这个问题.. Thnaks Dileep

解决方案

但是现在它只支持数字..我需要,它包括数字也支持+符号.. Plz帮助我来解决这个问题.. Thnaks Dileep ^ \\ +?[0-9] +

msdn.microsoft/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]+

" msdn.microsoft/en-us/library/az24scfc.aspx[^] And we have a Regular Expessions forum here.

更多推荐

正则表达式问题....

本文发布于:2023-10-24 09:31:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523582.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:正则表达式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!