goldenasian
goldenasian

Reputation: 274

find line do not have two consecutive zeros

I'm trying to find line that does not have two consecutive zeroes and alphabet.

so I tried:

grep -v "00|[a-z]" filename

but didn't work....

how can I solve this?

Upvotes: 0

Views: 54

Answers (3)

Ed Morton
Ed Morton

Reputation: 203324

awk '!(/00/ && /[a-z]/)' filename

Upvotes: 0

alani
alani

Reputation: 13069

perl -lne 'print unless /00/ && /[a-z]/' filename

Upvotes: 0

stark
stark

Reputation: 13189

Split to two separate conditions

grep -v -e '00' -e '[a-z]'

Upvotes: 1

Related Questions