将行的最后一个字转移到Notepad++中的新行



所以我有大约40k行INSERT,如下所示:

INSERT INTO dbo.table (something) values ('something') GO

但我想使用Regex:将单词GO移到新行上

   INSERT INTO dbo.table (something) values ('something') 
    
    GO

我该怎么做?

只需提取GO并将其替换为nGO

试试这个:

const input = `
INSERT INTO dbo.table (something) values ('something') GO
INSERT INTO dbo.table (something) values ('something') GO
INSERT INTO dbo.table (something) values ('something') GO
`
const res = input.replace(/(w+)$/gm, 'n$1')
console.log(res)

最新更新