I need to create a regex that validates any text with no dots or any text ending with .gt
or .lt
. Any text with more that one dot should also be invalid.
anytext // valid
anytext.gt // valid
anytext.lt // valid
anytext.xx // invalid
anytext.xx.gt // invalid
I've created this: ^.*(\.(gt|lt)|(?<!\..*))$
It works well except by the fact that it accepts more than 1 dot, so something like foo.bar.gt
is being validated and should not.