![有关在位置添加标签的更多信息 (Notepad++)](https://linux22.com/image/1579224/%E6%9C%89%E5%85%B3%E5%9C%A8%E4%BD%8D%E7%BD%AE%E6%B7%BB%E5%8A%A0%E6%A0%87%E7%AD%BE%E7%9A%84%E6%9B%B4%E5%A4%9A%E4%BF%A1%E6%81%AF%20(Notepad%2B%2B).png)
嗨,我正在尝试学习如何自己弄清楚如何在我需要的地方输入标签,所以,现在我有;
Kona Cotton:Violet Craft 设计师调色板 - Violet Craft FQ-1481-20 每捆 28.00 美元
我需要的是;
Kona Cotton:Violet Craft 设计师调色板 - Violet Craft [TAB] FQ-1481-20[TAB]每捆 28.00 美元
而且代码都是不同的,唯一不会改变的是产品代码旁边的 $ 符号位置,并且产品代码始终以 FQ 开头-
答案1
答案2
- Ctrl+H
- 找什么:
\h+(FQ-.+?)(?=\$)
- 用。。。来代替:
\t$1\t
- 检查匹配大小写
- 检查环绕
- 检查正则表达式
- 取消选中
. matches newline
- Replace all
解释:
\h+ # 1 or more horizontal spaces
( # start group 1
FQ- # literally FQ-
.+? # 1 or more any character but newline, not greedy
) # end group
(?=\$) # positive lookahead, zero-length assertion that make sure we have a $ sign after
替代品:
\t # a tabulation
$1 # content of group 1
\t # a tabulation
给定示例的结果:
Kona Cotton: Violet Craft Designer Palette - Violet Craft FQ-1481-20 $28.00 per bundle