Re: isolating text in a string

2008-07-05 Thread Perl WANNABE
* John W. Krahn <[EMAIL PROTECTED]> [2008-06-27 11:28]: > Tim Bowden wrote: >> On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: >>> >>> Perhaps: >>> >>> my ( $snippet ) = $string =~ /\w\["([^"]+)",/; >> >> $string =~ /\w\["([^"]+)",/; >> my $snippet = $1; >> >> does the trick. I can see If

Re: isolating text in a string

2008-07-05 Thread John W. Krahn
Perl WANNABE wrote: * John W. Krahn <[EMAIL PROTECTED]> [2008-06-27 11:28]: Tim Bowden wrote: On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: Perhaps: my ( $snippet ) = $string =~ /\w\["([^"]+)",/; $string =~ /\w\["([^"]+)",/; my $snippet = $1; does the trick. I can see If I

Re: isolating text in a string

2008-06-27 Thread John W. Krahn
Tim Bowden wrote: On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: Perhaps: my ( $snippet ) = $string =~ /\w\["([^"]+)",/; $string =~ /\w\["([^"]+)",/; my $snippet = $1; does the trick. I can see If I don't get on top of regex's I'm seriously restricting the power of perl. Starting

Re: isolating text in a string

2008-06-26 Thread Tim Bowden
On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: > Tim Bowden wrote: > > Hi, > > Hello, > > > I'm trying to isolate text in a string. My string is typically of the > > form: > > sometext["moretext", > > > > I would like to isolate moretext. > > > > I tried: > > #!/usr/bin/perl -w > > my

Re: isolating text in a string

2008-06-25 Thread sisyphus
On Jun 25, 11:20 am, [EMAIL PROTECTED] (Tim Bowden) wrote: > Hi, > > I'm trying to isolate text in a string. My string is typically of the > form: > sometext["moretext", > > I would like to isolate moretext. > > I tried: > #!/usr/bin/perl -w > my $string = 'sometext["moretext",'; > print $string; >

Re: isolating text in a string

2008-06-24 Thread John W. Krahn
Tim Bowden wrote: Hi, Hello, I'm trying to isolate text in a string. My string is typically of the form: sometext["moretext", I would like to isolate moretext. I tried: #!/usr/bin/perl -w my $string = 'sometext["moretext",'; print $string; my $snippet; ($snippet, $snippet) = split(/$string/

isolating text in a string

2008-06-24 Thread Tim Bowden
Hi, I'm trying to isolate text in a string. My string is typically of the form: sometext["moretext", I would like to isolate moretext. I tried: #!/usr/bin/perl -w my $string = 'sometext["moretext",'; print $string; my $snippet; ($snippet, $snippet) = split(/$string/,\[,2); print "$snippet\n"; I