3 deleted 5 characters in body; edited title
source | link

inverse Inverse regex in awkAWK?

I am trying to filter out the lines containing a particular word. The The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What i haveI've tried:

regex = "\?\\!domain" 

(negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

inverse regex in awk

I am trying to filter out the lines containing a particular word. The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What i have tried:

regex = "\?\\!domain" 

(negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

Inverse regex in AWK?

I am trying to filter out the lines containing a particular word. The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What I've tried:

regex = "\?\\!domain" 

(negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

2 deleted 118 characters in body
source | link

I am trying to filter out the lines containing a particular word. The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What i have tried:

regex = "\?\\!domain" 

regex = "\?\!domain" (negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

Spent hours trying out all combinations, but nothing worked in my way.So finally posting here, for help.

Thanks, -Venkat

I am trying to filter out the lines containing a particular word. The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What i have tried:

regex = "\?\!domain" (negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

Spent hours trying out all combinations, but nothing worked in my way.So finally posting here, for help.

Thanks, -Venkat

I am trying to filter out the lines containing a particular word. The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What i have tried:

regex = "\?\\!domain" 

(negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

1
source | link

inverse regex in awk

I am trying to filter out the lines containing a particular word. The regex is command line input to the script.

$0 ~ regex {
//Do something.
}

Sample input is:

**String** **number**
domain  1
domain  2
bla     3

So, from the above input, user can say - filter out the rows which have word "domain".

What i have tried:

regex = "\?\!domain" (negative lookahead).

But this regex is filtering out every row. Not just the rows with word "domain".

Spent hours trying out all combinations, but nothing worked in my way.So finally posting here, for help.

Thanks, -Venkat