检测函数名称的正则表达式问题

时间:2015-11-12 00:21:03

标签: regex

我正在编写语法高亮显示,需要能够在这种语法中找到Funct1,Funct2,Funct3。

Integer : Funct1 Integer n  //return type : name Input
    //code
    -> //return
 : Funct2 Integer k //void return
    //code

Class :: BaseClass
    //code
    : Funct3 Integer s
        //code

我在在线正则表达式测试网站上尝试过的正则表达式都没有。如果有人能够教会我如何检测每一个案例中的函数名称,我将非常感激。

1 个答案:

答案 0 :(得分:0)

(?<=:)\s*(\S+)\s*

这对我有用。

相关问题