I'm trying to set a regex pattern on model rules for my username property. I just want to allow the user to use alpha-numeric characters and dots, but the username can not start/end with a dot/symbol and can not have two or more dots together.
Some examples that I don't want to happen
Some examples that are allowed
I have tried to create a regex but without complete success. Does someone can give me some tips about it!? The regexp I have so far is
but for some reason is giving me problems in some cases, like this "a.aaa". Any ideas about the correct regex?