【问题标题】:Replacement macros for NetbeansNetbeans 的替换宏
【发布时间】:2015-07-30 03:12:42
【问题描述】:

是否可以为 NetBeans 编写替换宏?

我需要将function is_active 替换为function isActive。使用短正则表达式似乎是不可能的。

所以我想知道是否可以编写这样的宏?

【问题讨论】:

    标签: regex netbeans macros


    【解决方案1】:

    疯狂的宏代码....

    我们不能正确使用find,所以我决定使用find-selection

    caret-begin            
    "function[^(]*_[a-z]"  
    selection-begin-line   
    find-selection
    remove-selection
    find
    
    # there is no loop, so you need to repeat this lines many-many times (too many may hang your IDE)
    caret-begin
    find-next
    caret-forward    
    caret-backward   
    delete-previous
    to-upper-case    
    

    要使用此宏,您需要将焦点设置在文档上并打开正则表达式查找选项。

    警告,可能会破坏您的代码。

    【讨论】:

    • 我发现使用查找/替换和历史记录更容易
    猜你喜欢
    • 1970-01-01
    • 2018-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多