开发者

Regular expression required [closed]

开发者 https://www.devze.com 2022-12-11 17:51 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

Please give me one regular expression which mathes these kind of name formats like:

1) M/S.KHALIL WARDE S.A.L.

2) Oliver Twist

Th开发者_Python百科e expression should allow alphabets, dot, space and / only.

thanks


Perhaps:

^[A-Za-z. /]+$

That matches uppercase A-Z, lowercase a-z, dot, space, and slash. The + means repeated one or more times (so this won't match an empty string). The leading ^ and trailing $ means the match is "anchored" to the start and end of the string, so it will check your whole string.

0

精彩评论

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