C#正则表达式验证 [英] C# regulara Expression validation

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

问题描述

嗨 我是正则表达式的新手.我正在使用C#win form应用程序.我需要使用正则表达式验证一个文本框,该文本框应允许az,AZ,0-9和特殊字符(例如hypen(-),下划线(_),斜杠) (/)和空格.
请帮助我为上述要求编写Regx表达式.

Hi I am new to regular expression.I am working on C# win form application.I need to validate one textbox using regular expression which should allow a-z,A-Z,0-9 and special characters like hypen(-),underscore(_),slash(/) and white space.
Please help me to write the Regx expression for the above requirement.

推荐答案

在这里您要走
Expresso-一种用于构建和测试正则表达式的工具 [ 30分钟正则表达式教程 [
Here you go
Expresso - A Tool for Building and Testing Regular Expressions[^]
The 30 Minute Regex Tutorial[^]


这是我用于密码字段的ReGex ...所有允许使用字母和符号,范围从0到最大... *表示= 0或大于0可以存在

^ [a-zA-Z0-9] * [!,@,#,
here is the ReGex i use for password fields... all the letters and symbols are allowed, and range is from 0 to maximum... * represents= 0 or more than 0 can exists

^[a-zA-Z0-9]*[!,@,#,


,%,^,&,*,?,_,〜,-,£,( ,)] *
,%,^,&,*,?,_,~,-,£,(,)]*


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

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