^[A-Za-z0-9_.]+$
From beginning until the end of the string, match one or more of these characters.
Edit:
Note that ^
and $
match the beginning and the end of a line. When multiline is enabled, this can mean that one line matches, but not the complete string.
Use A
for the beginning of the string, and z
for the end.
See for example: http://msdn.microsoft.com/en-us/library/h5181w5w(v=vs.110).aspx
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…