如何反转匹配结果?

我检查了很多有关如何反转比赛的信息。但是很遗憾,我无法解决我的问题。所以..说我有这个文本:

GS Sos_519 082_KO_Ge124222sshelden892 345

My goal is to match eveything that is not XYZ XYZ. So i would like my results to be: 519 082892 345. Right now i've managed to do the opposite using this regex: \d\d\d\s\d\d\d. It matches exactly what i want not to be matched :). I've tryied to invert it using regex like this :

^(?:[\d\d\d\s\d\d\d].)*$

但不幸的是,它不匹配任何东西。我是正则表达式的新手,我将不胜感激。 先感谢您 !

评论