You won’t be able to do it in a single replacement; you’ll have to perform a few steps. Here’s how I’d do it:
-
Find (in regular expression mode):
(.+)Replace with:
"\1"This adds the quotes:
"AliceBlue" "AntiqueWhite" "Aqua" "Aquamarine" "Azure" "Beige" "Bisque" "Black" "BlanchedAlmond" -
Find (in extended mode):
\r\nReplace with (with a space after the comma, not shown):
,This converts the lines into a comma-separated list:
"AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond" -
Add the
var myArray =assignment and braces manually:var myArray = ["AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond"];