Matching only the first occurrence in a line and replace with predefine format using Regex in VS Code
I am new to regex, and I would greatly appreciate any help.
I have a CSV file with 1750 records that read like this:
dolphinsquare.co.uk,Dolphin Square,Real Estate,en,2,dolphin_square,dolphinsquaresw1,9
delrentals.com,Del Condominium Rentals,Real Estate,en,2,delrentals,delrentals,71
place.com,PLACE,Real Estate,en,1,poweredbyplace,poweredbyplace,107
diamandis.com,DIAMANDIS,Real Estate,en,5,,peterdiamandis,5
I would like each line transformed to follow a specific format.
[dolphinsquare.co.uk](dolphinsquare.co.uk),Dolphin Square,Real Estate,en,2,dolphin_square,dolphinsquaresw1,9
[delrentals.com](delrentals.com),Del Condominium Rentals,Real Estate,en,2,delrentals,delrentals,71
With the help of Stack Exchange answers, I can search for the first occurrence of every line using this:
^([^,]+),
But couldn’t figure out how to replace.
Read more here: Source link
