如何在一组字母字符和数字字符之间插入 space?
How can I insert a space in between a group of alpha characters and numeric character?
如何使用 Atom 编辑器的查找和替换功能将 Python3
和 Python2
替换为 Python (3|2)
?
到目前为止,我已经尝试过这些表达式:
find: Python[0-9]
replace: Python
find: Python[0-9]
replace: Python
find: Python[^\s](.*?)\s
replace: Python
find: Python+[0-9]
replace: Python
不幸的是,none 它们按预期工作,一些 字面上 将 2
或 3
替换为
。
有人可以阐明为什么每个表达式都不起作用以及我做错了什么吗?
我想得到更好的理解,因此将不胜感激。
提前致谢。
使用这个:
find: Python([23])
replace: Python
您必须捕获(在查找中)要替换的部分,然后在替换中用 $1 引用它。
您还可以使用它来查找 2 个捕获组并将它们都替换:
find: (Python)([23])
replace:
如何使用 Atom 编辑器的查找和替换功能将 Python3
和 Python2
替换为 Python (3|2)
?
到目前为止,我已经尝试过这些表达式:
find: Python[0-9]
replace: Python
find: Python[0-9]
replace: Python
find: Python[^\s](.*?)\s
replace: Python
find: Python+[0-9]
replace: Python
不幸的是,none 它们按预期工作,一些 字面上 将 2
或 3
替换为 。
有人可以阐明为什么每个表达式都不起作用以及我做错了什么吗?
我想得到更好的理解,因此将不胜感激。
提前致谢。
使用这个:
find: Python([23])
replace: Python
您必须捕获(在查找中)要替换的部分,然后在替换中用 $1 引用它。
您还可以使用它来查找 2 个捕获组并将它们都替换:
find: (Python)([23])
replace: