[Logan-pm] regex 1

Phillip Hellewell sshock at gmail.com
Thu Jun 21 18:34:08 PDT 2012


Here's my submission:

#!/usr/bin/perl
while( <> )
{
    if( /EXEC SQL/i )
    {
        print $_;
        if( /END-EXEC/i ) {
            next;
        }
        while( <> )
        {
            print $_;
            last if /END-EXEC/i;
        }
    }
}

On Thu, Jun 21, 2012 at 7:12 PM,  <david at davidscholes.com> wrote:
> Use a regular expression to extract all the SQL statements from a COBOL
> program.
>
> _______________________________________________
> Logan-pm mailing list
> Logan-pm at pm.org
> http://mail.pm.org/mailman/listinfo/logan-pm
>


More information about the Logan-pm mailing list