【问题标题】:How to echo out the regex matching characters in sublime text?如何在崇高文本中回显正则表达式匹配字符?
【发布时间】:2014-02-13 00:08:50
【问题描述】:

我在 sublime text 2 中使用正则表达式查找和替换来查找这些:

[A-z]-[A-z]

我想用

替换它们
[whatever A thru z char came before dash]spaceCharacter[whatever A thru z char came after dash]

例如,

input = D-f

应该让步

output = D f

sublime 中这个的语法是什么?

【问题讨论】:

  • 一些实际输入和预期输出会有所帮助。我想您希望 ([a-zA-Z])-([a-zA-Z]) 作为正则表达式和 $1 $2 作为替换。
  • 注意[A-z] 的意思是[A-Za-z\[\\\]^_`]

标签: regex sublimetext2


【解决方案1】:

试试这个:

查找

(?i)[a-z]-[a-z]

替换

$1 $2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-06
    • 2014-09-07
    相关资源
    最近更新 更多