fun with regex

2002-12-11 Thread Selector, Lev Y
Hello, Here is a regex question I am using the following construct to ident embeded SQL: ($sql =EOF) =~ s/^\s+SQL: ?//gm; SQL: select row_id SQL: from gs_employee_queue g_q SQL: where g_q.MMDDHHMM = '$MMDDhhmm' SQL:and g_q.action = 'D' SQL:and

A fun christmas ?

2002-12-11 Thread Matthew Byng-Maddick
I sent the following mail to the cam.pm list last week, it occurs to me that some of the fwp (or golf) denizens may be interested... http://www.cam.pm.org/archive/2002-December/000953.html MBM -- Matthew Byng-Maddick [EMAIL PROTECTED] http://colondot.net/

Re: fun with regex

2002-12-11 Thread Abigail
On Wed, Dec 11, 2002 at 11:33:13AM -0500, Selector, Lev Y wrote: Hello, Here is a regex question I am using the following construct to ident embeded SQL: ($sql =EOF) =~ s/^\s+SQL: ?//gm; SQL: select row_id SQL: from gs_employee_queue g_q SQL: where

Re: fun with regex

2002-12-11 Thread Jonathan E. Paton
Question: How to construct the regex so that it subtracts the same amount of white space from all the line. Namely, it should memorize the space from the first line only - and then subtract it from all the lines. I know how to do this with 2 regexes. But is there a way to do it in

Re: fun with regex

2002-12-11 Thread Jeff 'japhy' Pinyan
On Dec 12, Jonathan E. Paton said: (my $sql = '--') =~ s/\A(\s+)(?{$::c = $^N})|^(??{$::c})//gm; all over SQL related source code then your head is on the block! While it's cool, and I'D use it, for readability purposes, might I suggest: $sql =~ /(\s*)/ and $sql =~ s/^$1//mg; -- Jeff