如何编写一个接受除'和'之外的所有字符的正则表达式 [英] How to write a regular expression which will accept all character except ' and "

查看:100
本文介绍了如何编写一个接受除'和'之外的所有字符的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文本框中必须只过滤'和',除了'和',它会接受所有字符,特殊字符,字母数字



我是什么尝试过:



string FreeTextRegEx {get {return @^ [a-zA-Z-0-9~ +:;,/#& ; _ @ *%$!()\ [\]] * $; }}

解决方案

!()\ [\]] *


;}}


嗯。如果我看对了你,你想接受报价和双引号以外的所有东西吗?

如果是这样,那很简单:

 ^ [^'] * 

In a textbox have to filter only ' and ", except ' and " , it will accept all character, special character, alphanumeric

What I have tried:

string FreeTextRegEx { get { return @"^[a-zA-Z-0-9~+:;,/#&_@*%$!()\[\] ]*$"; } }

解决方案

!()\[\] ]*


"; } }


Um. If I read you right, you want to accept everything except quote and double quote?
If so, that's simple:

^[^'"]*


这篇关于如何编写一个接受除'和'之外的所有字符的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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