Data
Life by cerebral flow is coming to:---1) Prolonged jumping rate---2) Small holiday course---3) Hello this world---4) Dance rock coffee---5) Therapy unproven---Choose right answer:|1,3,5|2,5|1,2,3,5 5
...
Life by cerebral flow is coming to:---1) Prolonged jumping rate---2) Small holiday course---3) Hello this world---4) Dance rock coffee---5) Therapy unproven---Choose right answer:|1.,3.,5|2,5|1,2.,3,5 5
where each line contains like that [Sentence]:---1)...(options)---n) ---[choose right ansewr]:|options| \tab [correct answer]
.
I want to find all those sentences which does not have a match |[1-5],[1-5]?|
OR |[1-5].,[1-5]?|
so allowing also |1.,|
and |1,|
.
My pseudocode in Perl
perl -pe '
# read the file a record at a time and auto-print (-p)
s/[0-5],[0-5]?//; # remove those lines having the match
s/[0-5].,[0-5]?//; # remove those lines having the match
' file
where problem is removal of whole lines which have those matches. I can match those things but to say: remove the whole line with the match is the challenge.
How can remove those lines which have a match?