Regex for a-z, 0-9, . and -
regex
Solution
You can do: `"^[a-z][-a-z0-9\._]*$"`
Here is the breakdown
- `^` beginning of line
- `[a-z]` character class for lower values, to match the first letter
- `[-a-z0-9\._]` character class for the rest of the required value
- `*` zero or more for the last class
- `$` end of String
Problem
Can someone tell me what the syntax for a regex would be that would only allow the following characters: - a-z (lower case only) - 0-9 - period, dash, underscore Additionally the string must start with only a lower case letter (a-z) and cannot contain any spaces or other characters than listed above. Thank you in advance for the help, Justin