Regex to check for at least 3 characters?

前端 未结 4 1058
太阳男子
太阳男子 2020-12-06 16:04

I have this regex to allow for only alphanumeric characters.

How can I check that the string at least contains 3 alphabet characters as well.

My current rege

4条回答
  •  误落风尘
    2020-12-06 16:44

    You want to match zero or more digits then 3 consecutive letters then any other number of digits?

    /\d*(?:[a-zA-Z]){3,}\d*/

提交回复
热议问题