Today I wanted to edit all stops in a SQL INSERT that followed a Regex pattern. I realized that if I could use the multi cursor feature in Visual Studio Code I could make a ton of changes all at one time.
For instance, in the following SQL
INSERT INTO [dbo].[Location] (key, longName, shortName, oldRegion, contactId, email, city, state, zip, isActive)
VALUES
('GEORG','Georgian College','GEORG','1A','1271','globalint@school.edu','Barrie','ON','L4M 3X9','1'),
('LOYAL','Loyalist College','LOYAL','2A','1271','globalint@school.edu','Belleville','ON','K8N 5B9','0')
-- etc.
the contactId
and isActive
weren't really varchars, and I could find them with a regex of '\d+'
, but I couldn't figure out how to set the cursors to each spot with keyboard commands or shortcuts. How would you do this?