I have a huge file, and I want to blow away everything in the file except for what matches my regex. I know I can get matches and just extract those, but I want to keep my file and get rid of everything else.
Here's my regex:
"Id":\d+
How do I say "Match everything except "Id":\d+
". Something along the lines of
!("Id":\d+) (pseudo regex)
?
I want to use it with a Regex Replace function. In english I want to say:
Get all text that isn't
"Id":\d+
and replace it with and empty string.