2
For me it is always better to exemplify the cases of regex. Look at this:
- Palavra1- Valid
- Word2- Valid
- Palavra1 Word2- Valid
- Word2 Palavra1- Valid
- Palavra1 Palavra1- Invalidity
- Word2 Word2- Invalidity
But say it’s 5 or 6 words, it’s very expensive to write ALL possibilities
Ok! Well I didn’t know that 1 , well, there it is easy, first I check if it only contains the allowed words, then I check if there is no repetition !
– Rodrigo Santiago