Negation of sed regular expression

user2080209

I have a table in a text file with tab separator and I have a sed script that selects only those strings in my file that have 83, 86, 173, 163 in second column:

sed -n '/^[^\t]\+\t\(83\|89\|147\|163\)/p' test.txt

Now I want to select all the string that have anything else, but 83, 86, 173, 163 in second column. I've tried to put ^ in different places and tried to change p to d, but did't succeed.

Can anyone help me please?

user2080209

Solved my problem using ! before p:

sed -n '/^[^\t]\+\t\(83\|89\|147\|163\)/!p' test.txt

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Negation of regular expression

From Dev

Regular Expression - Negation String + OR

From Dev

Regular Expression - Negation String + OR

From Dev

Negation of regular expression

From Dev

Regular expression for multiple lines with negation

From Dev

Is there a negative regular expression in Python (negation)?

From Dev

the use of "+" in sed regular expression

From Dev

sed regular expression failure

From Dev

sed with regular expression

From Dev

the use of "+" in sed regular expression

From Dev

Regular expression with sed

From Dev

sed regular expression extraction

From Dev

sed command with regular expression

From Dev

Sed Regular Expression with /P

From Dev

+ Regular Expression not working in sed

From Dev

Eclipse File Search Dialog - Regular Expression for Group Unions and Negation

From Java

Escaping plus in sed regular expression

From Dev

sed positional replacement with regular expression

From Dev

Sed multiline regular expression issue

From Dev

understand Regular expression in a sed command

From Dev

sed regular expression failed on solaris

From Dev

sed: regular expression,how to substitute?

From Dev

sed replace regular expression match

From Dev

Using Sed in a for loop with a regular expression

From Dev

sed regular expression for escaped urls

From Dev

How to match everything but a regular expression with sed?

From Dev

Converting a sed regular expression to python code

From Java

regular expression in sed replace question mark

From Dev

Is there another regular-expression "flavor" in GNU sed?