Yeah, not implementing "non greedy" regular expressions is "not nice". In my not-so-humble opinion. IMO, IBM would have done much better by all to start with Linux as a "base" and do whatever was needed to get it POSIX compliant and certified. But, IBM tends to have NIH real bad. And z/OS development (or management) really seems to have it bad. Maybe I've been around the FOSS and GNU people too much recently.
-- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * [email protected] * www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM > -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:[email protected]] On Behalf Of Paul Gilmartin > Sent: Monday, February 06, 2012 10:45 AM > To: [email protected] > Subject: Re: Regular Expressions (OMVS) > > On Mon, 6 Feb 2012 10:29:07 -0600, McKown, John wrote: > > >> -----Original Message----- > >> From: IBM Mainframe Discussion List > >> [mailto:[email protected]] On Behalf Of Bill Godfrey > >> Sent: Monday, February 06, 2012 10:19 AM > ><snip> > >> > >> try this: > >> > >> awk 'sub(/CD[^Q]*QR/,"junkt")' > >> > >> or this: > >> > >> sed -e 's/CD[^Q]*QR/junkt/' > >> > >> Bill > > > >Will work on that specific example. But won't if a Q appears > with some other character after it, before the first QR. > > > Yup. Bill and I made the same mistake. But I've used a similar > construct to skip to the next delimiter, such as: > > "[^,]*, *" # skips to the next comma; swallows the comma > and trailing blanks. > > -- gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

