In <[email protected]>, on 02/06/2012
   at 11:25 AM, Bill Godfrey <[email protected]> said:

>Did you try it?

Trying it on a string that you know it handles isn't good enough; try
it on a string where a "Q" appears between the "CD" and the "QR".

>Where a Q appears with some other character after it, before the
>first QR?

It should match CDEFGNOPQSXXXPPPPABCDEFGNOPQR; instead it matches only
CDEFGNOPQR.

>It skips to the one that has the first QR, as it should.

It also skips past the first CD, which it shouldn't.

>echo "QQQQABCDEFGNOPQSXXXPPPPABCDEFGNOPQRYYYOOOOABCDEFGNOPQRZZZ" |
>awk 'sub(/CD[^Q]*QR/,"junkt")'

echo "QQQQABCDEQFGNOPQSXXXPPPPABCDEQFGNOPQRYYYOOOOABCDEQFGNOPQRZZZ" |
awk 'sub(/CD[^Q]*QR/,"junkt")'
 
-- 
     Shmuel (Seymour J.) Metz, SysProg and JOAT
     ISO position; see <http://patriot.net/~shmuel/resume/brief.html> 
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to