diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 8bb18dab3d5..71f51b23ebf 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -774,7 +774,7 @@ characters of the current line." @font-lock-builtin-face)) ;; user defined constant ((name) @font-lock-constant-face - (:match "_?[A-Z][0-9A-Z_]+" @font-lock-constant-face)) + (:match "\\`_?[A-Z][0-9A-Z_]+\\'" @font-lock-constant-face)) (const_declaration (const_element (name) @font-lock-constant-face)) (relative_scope "self") @font-lock-builtin-face