RE: simple string parsing

2002-12-27 Thread Paul Kraus
, 2002 2:16 PM > To: [EMAIL PROTECTED] > Subject: Re: simple string parsing > > > Ellie Quigley's Perl by Example is fantastic. > > >>> Robert Boardman <[EMAIL PROTECTED]> 12/27/02 11:50AM >>> > Thank you to everyone I now have a much better un

Re: simple string parsing

2002-12-27 Thread Michael Weber
Ellie Quigley's Perl by Example is fantastic. >>> Robert Boardman <[EMAIL PROTECTED]> 12/27/02 11:50AM >>> Thank you to everyone I now have a much better understanding of parsing lines, Robb PS could you recommend any good starter perl books? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: simple string parsing

2002-12-27 Thread Robert Boardman
Thank you to everyone I now have a much better understanding of parsing lines, Robb PS could you recommend any good starter perl books? On Fri, 2002-12-27 at 16:50, R. Joseph Newton wrote: > my $InString = " channel="carlton.com">" > if ($InString =~ /\bprogramme start=\"(.*)\" stop=\"(.*)\" cha

Re: simple string parsing

2002-12-27 Thread R. Joseph Newton
my $InString = "" if ($InString =~ /\bprogramme start=\"(.*)\" stop=\"(.*)\" channel=\"(.*)\"/) { my $programme = $1; my $start = $2; my $channel = $3; } What happens here is that the parentheses around each sought-after value set it to one of the built-in regex variables--$1, $2...$n, i

RE: simple string parsing

2002-12-27 Thread Kipp, James
> $string = "\ stop=\"20021222001000 > UTC\" channel=\"carlton.com\>"; > ($programme, $stop, $channel) = ($string =~ > m/\S+\s\S+\"(\d+)\s\S+\s\S+\"(\d+)\s\S+\s\S+\"(\S+)\"\>/); > > If the <> were not actually part of the string, this will > work the same > ($programme, $stop, $channel) = ($st

RE: simple string parsing

2002-12-27 Thread Jensen Kenneth B SrA AFPC/DPDMPQ
$string = "\"; ($programme, $stop, $channel) = ($string =~ m/\S+\s\S+\"(\d+)\s\S+\s\S+\"(\d+)\s\S+\s\S+\"(\S+)\"\>/); If the <> were not actually part of the string, this will work the same ($programme, $stop, $channel) = ($string =~ m/\S+\s\S+\"(\d+)\s\S+\s\S+\"(\d+)\s\S+\s\S+\"(\S+)\"/); Maybe