Valid in Lua, where the %w(almost) equivalent \win other languages
^[%w-.]+$ means matching a string that consists of alphanumeric characters (letters and numbers), dashes, or periods.
Explanation
- The core
^claims that we are at the beginning of the line - A character class
[%w-.]corresponds to one character, which is a letter or number (value %w), dash, or period. That would be equivalent [\w-.]in JavaScript +$ ,
Lua