preg_match/preg_replace syntax fix for PHP 5.6

The "-" needs to be escaped in preg_match() and preg_replace() or the following error is thrown: 
preg_match(): Compilation failed: invalid range in character class at offset 7