【发布时间】:2016-01-30 12:30:20
【问题描述】:
我想在我的 PHP 代码中使用 notepad++ 中的函数列表功能 实际上,如果我写了关闭 PHP 标记 ( ?> ),函数列表可以正常工作。但是如果我没有关闭 PHP 标记,则函数列表不起作用
我只是想要,即使我没有关闭PHP标签,函数列表仍然有效
查看图片 顶部没有关闭 PHP 标记 底部带有关闭的 PHP 标记
然后我读到了这个,notepad++ 函数列表文档 https://notepad-plus-plus.org/features/function-list.html
我想,我需要编辑正则表达式。但问题是我无法编辑正则表达式,因为正则表达式看起来对我来说太复杂了
这是PHP函数列表的正则表达式和xml
<parser id="php_function" displayName="PHP" commentExpr="((/\*.*?\*)/|(//.*?$))">
<classRange
mainExpr="^[\s]*(class|abstract[\s]+class|final[\s]+class)[\t ]+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*([\s]*|[\s]*(extends|implements|(extends[\s]+(\\|[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+[\s]+implements))[\s]+(\,[\s]*|(\\|[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))+[\s]*)?\{"
openSymbole = "\{"
closeSymbole = "\}"
displayMode="node">
<className>
<nameExpr expr="(class|abstract[\s]+class|final[\s]+class)[\s]+[\w]+"/>
<nameExpr expr="[\s]+[\w]+\Z"/>
<nameExpr expr="[\w]+\Z"/>
</className>
<function
mainExpr="^[\s]*((static|public|protected|private|final)*(\s+(static|public|protected|private|final))+[\s]+)?(function[\s]+)+([\w]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\{]*\{">
<functionName>
<funcNameExpr expr="(?!(if|while|for|switch))[\w_]+[\s]*\([^\{]*"/>
<!-- comment below node if want display method with parmas -->
<funcNameExpr expr="(?!(if|while|for|switch))[\w_]+"/>
</functionName>
</function>
</classRange>
<function
mainExpr="^[\s]*function[\s]+\w+\("
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="(?!(if|while|for))[\w_]+[\s]*\("/>
<nameExpr expr="(?!(if|while|for))[\w_]+"/>
</functionName>
<className>
<nameExpr expr="[\w_]+(?=[\s]*::)"/>
</className>
</function>
</parser>
谁能帮帮我
谢谢
【问题讨论】:
-
抱歉英语不好
-
那你自己写答案
标签: php regex function plugins notepad++