Hallo,
I've got a file with a LOT of lines that match the following regular expression: ([0-9]+);([^;]+);([0-9]+);([0-9.]+);\n
But within that file there are a few lines that don't match (in various ways) and I've got to find those lines. Is there a way to tell TextMate: "Find everything that DOESN'T match the given regular expression"?
Kind regards, Tobias Jung
On Mon, 11 Dec 2006 14:41:32 -0000, Tobias Jung newsgr@tobiasjung.net wrote:
I've got a file with a LOT of lines that match the following regular expression: ([0-9]+);([^;]+);([0-9]+);([0-9.]+);\n
But within that file there are a few lines that don't match (in various ways) and I've got to find those lines. Is there a way to tell TextMate: "Find everything that DOESN'T match the given regular expression"?
You could use shell command egrep with -v switch.
On Dec 11, 2006, at 9:41 AM, Tobias Jung wrote:
Hallo,
I've got a file with a LOT of lines that match the following regular expression: ([0-9]+);([^;]+);([0-9]+);([0-9.]+);\n
But within that file there are a few lines that don't match (in various ways) and I've got to find those lines. Is there a way to tell TextMate: "Find everything that DOESN'T match the given regular expression"?
If this is a one time thing, you could use Filter Through Command… (⌥⌘R) and run the file through `egrep -v [pattern]`. If you're tying to match this on a more permanent basis (in a Language Grammar or something) then I'm not sure off the top of my head, but I'll bet the answer is on its way from someone else.
--- Rob McBroom http://www.skurfer.com/ I didn't "switch" to Apple... my OS did.
At 10:53 Uhr -0500 11.12.2006, Rob McBroom wrote:
I've got a file with a LOT of lines that match the following regular expression: ([0-9]+);([^;]+);([0-9]+);([0-9.]+);\n
But within that file there are a few lines that don't match (in various ways) and I've got to find those lines. Is there a way to tell TextMate: "Find everything that DOESN'T match the given regular expression"?
If this is a one time thing, you could use Filter Through Command (R) and run the file through `egrep -v [pattern]`. If you're tying to match this on a more permanent basis (in a Language Grammar or something) then I'm not sure off the top of my head, but I'll bet the answer is on its way from someone else.
It was a one time thing indeed, so you were pointing me into the right direction. Thanks a lot! :-)
Kind regards, Tobias
I don't remember when it got added but in the Text bundle, under Filtering there are exactly these sort of options -- you'll probably want Copy Non-Matching Lines into New Document.
If you don't have these options you'll probably need to update to a newer version of TextMate - I run mine on cutting-edge... Or you could do a checkout or update from the subversion repository to get the latest versions which should have those commands in.
Andy
On 11 Dec 2006, at 14:41, Tobias Jung wrote:
Hallo,
I've got a file with a LOT of lines that match the following regular expression: ([0-9]+);([^;]+);([0-9]+);([0-9.]+);\n
But within that file there are a few lines that don't match (in various ways) and I've got to find those lines. Is there a way to tell TextMate: "Find everything that DOESN'T match the given regular expression"?
Kind regards, Tobias Jung
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
At 18:49 Uhr +0000 11.12.2006, Andrew Henson wrote:
I don't remember when it got added but in the Text bundle, under Filtering there are exactly these sort of options -- you'll probably want Copy Non-Matching Lines into New Document.
If you don't have these options you'll probably need to update to a newer version of TextMate
I dont' have the options (yet)... For now Rob McBrooms suggestion helped me, but thank you, too! Next time, I'll check the Text bundle.
Kind regards, Tobias Jung