Assuming php regex matches perl
^\w+\.[\.\w]+$
This means that it starts with one or more alphanumeric characters, followed by . followed by a few alphanumeric characters or . . $ means all the way to the end of the line.
If it cannot end with a symbol . then
^\w+\.[\.\w]+\w$
If .. not allowed, it becomes harder because ell regex mechanisms that indicate repetition of multi char subexpressions are not processed. But if so, I think something like
^\w+(\.\w+)+$
This means starting with one or more alphanumeric characters, after one or more repetitions on . followed by one or more alphanumeric characters. $ means all the way to the end of the line.
source share