I am looking for help to create a regex for checking a string that satisfies these 4 criteria:
- The string must contain a space.
- The line should end with a full stop / period.
- The string must contain at least 15 characters.
- The string must not contain a repetition of 3 or more characters. This is the part that I am especially struggling with.
For instance:
Pass
Renouncement
- OOOne two thee four.
- Two of your affairs.
- One two three four
- Two three.
- Onetwothreefour.
If possible, could you explain how the regex is built to give me a better idea of โโhow to build them in the future?
Here is what I have tried so far,
^(.*?={15,})(\.\Z)$
but Iโm afraid that it wonโt even close, please help.
source share