如何用正则表达式删除代码后面的40个字符



所以这是我的字符串

(116, 'string', NULL, 557, 2, NULL, 2, 1, 20, 'randomstring-code1_572af4e5c31c72d9d1ae3433237888c413f527b0.zip', 'code2_dba025e084f4a195109add0a119cbfa19ec41552.jpg', 1, 0, 'path', '2021-04-19 12:55:37', '2021-04-18 22:11:21'),

我想删除代码1后的40个字符串_所以它将是


(116, 'string', NULL, 557, 2, NULL, 2, 1, 20, 'randomstring code1_.zip', 'code2_dba025e084f4a195109add0a119cbfa19ec41552.jpg', 1, 0, 'path', '2021-04-19 12:55:37', '2021-04-18 22:11:21'),

怎么做?提前感谢

您可以在regex模式下尝试以下查找和替换:

Find:    '(S+)-code1_.*?.zip'
Replace: $1 code1_.zip

演示

最新更新