I have a Java program that should match a string if it contains a hyphen for more than 5 times in it:
hello-hi-contains-more-than-five-hyphen
The words can contain any regular characters.
The regex should not match on this example:
hi-hello-233-here-example
I tried to write a regex like this:
.*-{6,}.*
But it doesn't works.