Hello,
Correct, forgive me I missed the point, that you need 7 characters no more, no less.
Then, you have to build a regex, you were right, have a look on this
Stackoverflow
topic.
=> Example :
^[:;,\-@0-9a-zA-Zâéè'.\s]{1,7}$
This regex may be useful for your needs, I add another tips in order to help you to build regex, which is often a job that can be complicated, even for us.
=> Use this online
regex tool
to test & analyze.
And so, in order to check that your input contains a valid email, you can use this kind of regex (
Stackoverflow link
).
Hope this will help you to achieved what you need.
regards