Re: question about regex for selecting and copying the result into array.

2007-10-09 Thread Patrik Hasibuan
On Tue, 09 Oct 2007 13:29:53 -0700 "John W. Krahn" <[EMAIL PROTECTED]> wrote: PH>Dear John... > $_ = $kontenurl->gogeturl( $assprm{'kwnya'}, $urlnya, $nohal ); > print $_; > > But why not just: > > print $kontenurl->gogeturl( $assprm{'kwnya'}, $urlnya, $nohal ); PH>Because I want to put the res

Re: question about regex for selecting and copying the result into array.

2007-10-09 Thread John W. Krahn
Patrik Hasibuan wrote: Dear my friends... Hello, I want to take all the strings between "" and "" and put it into array. I do this way but it does not work properly: Put these two lines at the start of your program: use warnings; use strict; $kontenurl=eksekusi->baru(); eksekusi is

question about regex for selecting and copying the result into array.

2007-10-09 Thread Patrik Hasibuan
Dear my friends... I want to take all the strings between "" and "" and put it into array. I do this way but it does not work properly: $kontenurl=eksekusi->baru(); $_=$kontenurl->gogeturl("$assprm{'kwnya'}", "$urlnya", "$nohal"); print "$_"; print ""; print ""; $i=0; while (<>){ @resul

Re: newbie question about regex

2004-09-03 Thread David Dorward
On Fri, Sep 03, 2004 at 04:33:43PM +0200, Maurice Lucas wrote: > $ ./count.pl /var/log/file text > this works fine but sometimes the "text" is "foo(bar)" and then my scripts > gives an error. > syntax error near unexpected token `foo(b' That's a shell issue, not a Perl issue. Escape your brackets

Re: newbie question about regex

2004-09-03 Thread Maurice Lucas
Hello, I call my script with the following line $ ./count.pl /var/log/file text this works fine but sometimes the "text" is "foo(bar)" and then my scripts gives an error. syntax error near unexpected token `foo(b' I believe the syntax error is from your shell and you can get around this by quoting

Re: newbie question about regex

2004-09-03 Thread Wiggins d Anconia
> Hello, > > I call my script with the following line > $ ./count.pl /var/log/file text > this works fine but sometimes the "text" is "foo(bar)" and then my scripts > gives an error. > syntax error near unexpected token `foo(b' > I believe the syntax error is from your shell and you can get ar

newbie question about regex

2004-09-03 Thread Maurice Lucas
Hello, I call my script with the following line $ ./count.pl /var/log/file text this works fine but sometimes the "text" is "foo(bar)" and then my scripts gives an error. syntax error near unexpected token `foo(b' Could somebody give me a hint? I'm working on linux My script #!/usr/bin/perl

Re: RegExp Help ! (appended question about regex choice ( [^\"]*)vs. (+*?))

2004-05-11 Thread John W. Krahn
William M West wrote: > > David Dorward wrote: > > > >(my $action) = ($html =~ /action=\"(.*?)\"/); > > > >That gives the same as my example. > > using parentheses to capture matches is really neat :) i > did not know that you could do that. It is not the parentheses per se that capture matche

Re: question about regex

2002-02-25 Thread Tanton Gibbs
]> Sent: Monday, February 25, 2002 8:07 PM Subject: question about regex > Hi, All: > > I have problem with regex. I try to get some content > from a html source and print it out on the screen. > the following is my code: > > use LWP::Simple qw(get); > my $url = "h

question about regex

2002-02-25 Thread Yuan Cheng
Hi, All: I have problem with regex. I try to get some content from a html source and print it out on the screen. the following is my code: use LWP::Simple qw(get); my $url = "http://www.somewebsite.com";; my $html = get($url); my $index = "some index number"; my @result = $html =~ /.*$index.*(

Re: question about regex back referencing

2001-07-02 Thread Peter Cline
At 04:41 PM 7/2/01 -0400, Jeff 'japhy' Pinyan wrote: >On Jul 2, Peter Cline said: > > >if (/^(.+)_(\d+)$/) { > > $script_info[$2] = { 'id' => $2, } unless { > >defined($script_info[$2]) }; > > $script_info[$2]->{$1} = $q->param("$_"); > > } > > > >and thereby eliminated my

Re: question about regex back referencing

2001-07-02 Thread Jeff 'japhy' Pinyan
On Jul 2, Peter Cline said: >if (/^(.+)_(\d+)$/) { > $script_info[$2] = { 'id' => $2, } unless { >defined($script_info[$2]) }; > $script_info[$2]->{$1} = $q->param("$_"); > } > >and thereby eliminated my problem. Or not. print "foo" unless { 1 }; print "bar" unless

Re: question about regex back referencing

2001-07-02 Thread Peter Cline
It seems that posting to the list is often the catalyst that provides enough activation energy to prompt the revelation that gives me the answer I need. I now see the folly of if (/^(.+)_(\d+)$/) { $script_info[$2] = { 'id' => $2, } $script_info[$2]->{$1} = $q->param("$_");

Question about Regex back referencing

2001-07-02 Thread Peter Cline
Hello all. I am using the following subroutine and it is exhibitng an undesirable behavior that I can't figure out how to change. The array @names consists of elements that alternate between domain_# and product_# with # representing some positive integral value. Also, two subsequent entries