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.
精彩评论