Preg Match
When Using this pattern
$pattern = '/[a-zA-Z0-9_-]+$/';
It will match a-z 0-9 and _ but not the -
Where have I gone wrong?
Thanks.
Looks to me like it should work. Do you have a specific example where it does not? (There might be some logic error or other bug that's making you think it's the regex that's the problem.)