I have a String of which comes like
POC41
POC85
POC71
POC03
and I want this to be changed to ('POC41','POC85','POC71','POC03') For this I use Notepad++ and do find \r\n and replace as ',' and select Extended option and replace all. Then I join the string with npp function and get the outcome as POC41','POC85','POC71','POC03','
I want the outcome to come as ('POC41','POC85','POC71','POC03')
Is there any regular expression in notepad++ by which I can achieve like this?
(.+)(\R)?
'$1'(?2,)
. matches newline
Explanation:
(.+) # group 1, 1 or more any character but newline
(\R)? # group 2, any kind of linebreak, optional
Replacement:
'$1' # content of group 1 surrounded by single quotes
(?2,) # condiotnal replacement, if group 2 exists, add a comma
Screenshot (before):
Screenshot (after):
^.+$
\($0\)
. matches newline