如何使用正则表达式在 Notepad++ 中将 `abc` 替换为 `abc'

How to replace `abc` to `abc'` in Notepad++ using Regex

原文:

set    ,     1
note   ,     1
hello  ,     1

预期文本:

set'    ,     1
note'   ,     1
hello'  ,     1

我尝试将 [a-z]\s 替换为 ',但它会丢失最后一个字符。

[a-z]表示az之间的一个字符,必须使用[a-z]++表示一个或多个字符。

我建议你使用:

^([a-z]+)

并在替换字段中写入:

'

^ 表示字符串的开头。 </code> 是一个变量,您将匹配的字符串存储在括号 <code>().

试试这个

([a-z])\s

Regex demo

换人: '