Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Passing a regex from a CGI HTML form [EXAMPLE DATA]

by stevieb (Canon)
on Aug 31, 2016 at 19:47 UTC ( [id://1170923]=note: print w/replies, xml ) Need Help??


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

    "Are those full lines?"

    I wish, that is one little line... in that format - there are between 5 to 10 for each player that changes randomly, and remember, the data copied 'n' pasted changes quiet a lot on the fly depending on games/injuries/banned/transfers- that is the issue. So I need a way to get new subsititions in for a temporary measure until I can re-code the code when I get home.

    Nick

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170923]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found