in reply to Re^3: Passing a regex from a CGI HTML form [EXAMPLE DATA]
in thread Passing a regex from a CGI HTML form
Are those full lines? I mean, is this a situation where you can just grab the first and last non-whitespace chars, and just not bother with the stuff in between? ie. does the below code work in your cases, or are there other things that need consideration?
use warnings; use strict; while (<DATA>){ if (/^(\w+).*\s(\w+)/){ my $line = "$1,$2"; print "$line\n"; } } __DATA__ SWA vs CHE GK WBA @ BOU GK EVE GK EVE 4 87 dwqer *** GK
Output:
SWA,GK WBA,GK EVE,GK EVE,GK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Passing a regex from a CGI HTML form [EXAMPLE DATA]
by Linicks (Scribe) on Aug 31, 2016 at 20:04 UTC |