I am looking for help to create a Regex to validates a string that satisfies these 4 criteria:
For example:
Pass
Fail
If possible could you explain how the regex is constructed to give me a better idea of how to construct them in future?
Here is what I've tried so far,
^(.*?={15,})(\.\Z)$
but I fear its not even close, please help.
You can use this regex:
^(?=\S*\s)(?!.*?(.)\1{2}).{14,}\.$
Explanation:
(?=\S*\s)
- Lookahead to make sure there is at least one whitespace(?!.*?(.)\1{2})
- Negative Lookahead to make sure there is no case of 3 consecutive characters.{14,}
to make sure there are at least 14 characters (15th being the last dot)\.$
to make sure dot is always the last characterIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With