4
I want to make input text allow only the following strings:
site.com; site.com.br; site123.com123.br; site-123.com.br. But never: site-123-.com.br
My expression was like this:
(([a-z0-9-]{3,})[^-])+\.([a-z0-9]{2,})(([.]{1})([a-z]{2}))?
That way, when I type: site.co*/@m.br, it’s accepting.
That is, I want you to accept strokes, but never at the end of the first string or before the first dot.
Thank you, Humberto! Solved my question! I just saw how you did in your expression, and I added little else to mine:
(([w]{3})\.)?[a-z0-9](([a-z0-9-]{3,}))[a-z0-9]+\.([a-z0-9]{2,})(([.]{1})([a-z]{2}))?
– Renan Coelho