Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select text and replace text with text + variable in Notepad++?

Apologies, I am quite new to stackoverflow and not sure if this is a suitable question but I have already attempted to find the answer elsewhere

I have the line:

XYZ: "Text"

and am attempting to replace

XYZ: "Text"

with

XYZ: "Text (XYZ)"

is this possible with notepad++, it seems as though I need to select a variable within every line and then replace some text within the line with the text + (variable) can anyone think of a way to do this in Notepad++?

Note: The text on all lines is different and so is XYZ so I need it to be specific to each and every line

like image 774
Lawrence Clarkson Avatar asked Aug 30 '25 16:08

Lawrence Clarkson


1 Answers

You can use this pattern for search (^[^:]*)(:[^"]*"[^"]*) and $1$2 \($1\) for replacement.

Demo

like image 110
Dzienny Avatar answered Sep 02 '25 11:09

Dzienny