开发者

Regular expressions in asp.net c#

开发者 https://www.devze.com 2023-03-02 09:45 出处:网络
I have a simple query. I am new to regular expression validations in C#. I want some expression which would allow only single alphabet that means a-z or A-Z开发者_如何转开发. It should not allow whol

I have a simple query. I am new to regular expression validations in C#.

I want some expression which would allow only single alphabet that means a-z or A-Z开发者_如何转开发. It should not allow whole word. Can anyone suggest me an expression?


The following should work:

[a-zA-Z]+

This expression allows one or more characters in the specified range. And if you want only a single character:

[a-zA-Z]
0

精彩评论

暂无评论...
验证码 换一张
取 消