Skip to content

Commit 5cf6d38

Browse files
committed
Update regex for element name validation
1 parent 5eff634 commit 5cf6d38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Parser/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static function getNamespacePrefix(string $name): ?string
6060
*/
6161
private static function validateElementName(string $value): void
6262
{
63-
$regex = '/^[a-zA-Z][a-zA-Z0-9_]*(:[a-zA-Z][a-zA-Z0-9_]*)?$/';
63+
$regex = '/^([a-zA-Z_][\w.-]*)(:[a-zA-Z_][\w.-]*)?$/';
6464

6565
if (preg_match($regex, $value) !== 1) {
6666
throw new InvalidArgumentException(

0 commit comments

Comments
 (0)