Regex to replace values that include part of match in replacement in sublime?

后端 未结 1 1468
闹比i
闹比i 2021-01-31 14:43

I\'ve come up with this regex that finds all words that start with $ and contain _ underscores:

\\$(\\w+)_(\\w+)

I\'m basi

1条回答
  •  猫巷女王i
    2021-01-31 15:21

    The replacement expression is:

    \$\1\u\2
    
    • \1, \2 are the captures (or $1, $2)
    • \u up-cases (see the Replacement String Syntax section).

    See the Regular Expressions chapter (in the TextMate docs) for more information.

    There's already a package that does this, and more:

    • Brief blog about CaseConversion
    • CaseConversion package

    0 讨论(0)
提交回复
热议问题