使用正则表达式验证文本框时遇到的问题

时间:2019-07-02 07:37:34

标签: c# regex asp.net-mvc

我需要一个正则表达式来验证asp.net MVC应用程序中的文本框,以下是条件, 下面是我使用的正则表达式    <[^ A-Za-z] {1} | <[^!] <[^ /] | <[^?] | [^&#]请纠正我或给我有效的正则表达式(如果有人知道)。

1. It should not allow the string which starts with < and followed by 
        alphabets, 
    Ex: <abss ,<Abs
2.  It should not allow the below combinations
    Ex: <! and <? and </.
3.  It should not end wiht 
    Ex: &#
4.  It should allow the staring which starts with < and followed by numbers
    Ex: <123

0 个答案:

没有答案
相关问题