Fix misplaced hyphens in regex
authorElliott Eggleston <ejegg@ejegg.com>
Mon, 5 Nov 2018 19:54:55 +0000 (14:54 -0500)
committerElliott Eggleston <ejegg@ejegg.com>
Mon, 5 Nov 2018 19:54:55 +0000 (14:54 -0500)
commit38c9ed00ed8ca70e5c032e2f6ecc6eb59aaafc5e
treee15b730666c57541532eebf9a8e8d198536d9d35
parent3a327615280dc2fd33750d40a634cf4a1250f516
Fix misplaced hyphens in regex

Inside a character range surrounded by [], the hyphen is interpreted
as defining a range, unless it's the first character. Move the
hyphens to the first character in the square brackets where it's
supposed to be interpreted as a hyphen.

Under PHP 7.3, the previous code failed with error message
preg_match(): Compilation failed: invalid range in character class at offset 7
CRM/Utils/Rule.php