Alex Rivera | Logout

Regex match any character 5 or more times

Asked 2011-06-27T10:55:12.857
23

I have this regex pattern:

^[.]{5,}$

Which I want to return true if the tested string has 5 or more characters.

I.E it'll only return false if the string contains 4 or less characters.

At the moment it seems to return true regardless of the number of characters and I can't see why.

Edit
Report

1 Answer

3

I think you dont need the ^ and $. Try just:

.{5,}
answered 2011-06-27T10:58:26.327

Your Answer