Reputation: 11
i am looking for a regular expression to have EXACT 8 ocurrences, these occurences may be characters, numbers, special characters,etc..
I thought about this regex: .{8} But this allows you to enter more and is not an exact match,
Who could help me? Greetings
Upvotes: 1
Views: 3237
Reputation: 89557
You must add anchors to have an exact match:
^.{8}$
^ #begin of the string
$ #end of the string
Upvotes: 3