- Ctrl + H
- Найти что:
(?<!")\b\w+\b(?!")
- Заменить на:
"$0"
- check Обтекание
- check Регулярное выражение
- Заменить все
Объяснение:
(?<!") # negative lookbehind, make sure we haven't quote before the word
\b # word boundary
\w+ # 1 or more word character
\b # word boundary
(?!") # negative lookahead, make sure we haven't quote after the word
Замена:
" # a double quote
$0 # the whole match (i.e. the word)
" # a double quote
Дано:
Tony, Paul, Eric, Sarah, "Tony", "Paul", "Eric", "Sarah"
Результат для данного примера:
"Tony", "Paul", "Eric", "Sarah", "Tony", "Paul", "Eric", "Sarah"