简体   繁体   English

Emacs php-mode字体锁属性不适用于某些字符

[英]Emacs php-mode font-lock properties are not applied to certain chars

For example variable dollar signs. 例如可变美元符号。

php-mode.el line 1087: php-mode.el第1087行:

'("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable

If I'm not mistaken the regexp should match $variable including the dollar sign. 如果我没有弄错的话,正则表达式应该与$变量匹配,包括美元符号。 Now, i'm trying to figure out why isn't the font-lock property applied to the dollar sign also. 现在,我试图找出为什么不是应用于美元符号的字体锁属性。 In the syntax table $ is considered a word just like Az. 在语法表中,$被认为是一个像Az的单词。

So i guess what i'm trying to ask is: Did anyone experienced the same problem and has he/she found a solution? 所以我想我想问的是:有没有人遇到过同样的问题并且他/她找到了解决方案?

The 1 in there means match the first capture group denoted by (escaped) parens. 那里的1表示匹配由(转义的)parens表示的第一个捕获组。 The $ is outside that capture group. $在该捕获组之外。 So it could either be moved inside, or change the 1 to a 0 which means use the entire regexp. 因此它可以移入内部,或将1更改为0 ,这意味着使用整个正则表达式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM