开发者

Regex to allow apostrophe only for words ending with s

I'm using this Regex ^[a-zA-Z0-9]{2,20}$ to allow the followi开发者_如何学编程ng rules: - Letters a-z - Letters A-Z - Numbers 0-9 - Input length must be at least 2 characters and maximum 20 characters.

I also want to allow apostrophe only at the end of words ending with s.

Thanks,


^([a-zA-Z0-9]{2,20}|[a-zA-Z0-9]{2,18}'s)$

So: either your original regex, or your original regex (reduced to maximum 18 characters, you might want to change the minimum as well) ending in "'s".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜