崇高的正则表达式

时间:2014-09-12 07:45:42

标签: regex sublimetext2 syntax-highlighting

我有这个

(?i)^\s*(function|procedure|package)\s+([-a-z0-9_]+)

无论何时我写function fooprocedure foo

,都可以找到

我怎样才能改变它以便能够捕捉到这种方式?

function foo

我尝试在\n之前添加此\s+,但没有成功。

我有这样的方式:

<dict>
<key>captures</key>
<dict>
    <key>1</key>
    <dict>
        <key>name</key>
        <string>storage.type.function.oracle</string>
    </dict>
    <key>2</key>
    <dict>
        <key>name</key>
        <string>entity.name.function.oracle</string>
    </dict>
</dict>
<key>match</key>
<string>(?i)(function|procedure|package)\s+([-a-z0-9_]+)</string>
<key>name</key>
<string>meta.function.oracle</string>

1 个答案:

答案 0 :(得分:0)

以下正则表达式对我有用,

(?i)(function|procedure|package)\s+([-a-z0-9_]+)

enter image description here