Re: Matching text

2002-02-01 Thread Kevin Hancock
I have read about this before but it hadn't clicked. That helps clear up a lot of issues. Thanks > something like > if ($data =~ /User ([^ ]*)/) > { > $username = $1; > } > > what happends there is that it checks for the occurance of User then a > space followed by 0-* nonspace chars. it pu

Re: Matching text

2002-02-01 Thread Leon
- Original Message - From: "Kevin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 31, 2002 10:15 PM Subject: Matching text > I have have the following input. > > Active Accounted actions on tty57, User fred Priv 1 > Task ID 35176, Network Accounting record, 02:04:00

Re: Matching text

2002-02-01 Thread Jon Molin
Kevin wrote: > > Hi > > I have a really simple problem that I could solve easily with a strstr() call > in c but cannot get my head around in perl. > > I have have the following input. > > Active Accounted actions on tty57, User fred Priv 1 > Task ID 35176, Network Accounting record, 02:04:00

Re: Matching text, e.t.c.

2002-01-30 Thread John W. Krahn
Lorne Easton wrote: > > The following code: > > SNIP > > sub return_internal_links > { > > foreach my $element (@links) { > > my $all_internal = join("\n",@internal),"\n"; > > if (($element =~ m/$startingurl/i) && ($all_internal !~ m/$element/gi)) { > > print $element,"\n";

RE: Matching text, e.t.c.

2002-01-29 Thread Lorne Easton
The following code: SNIP sub return_internal_links { foreach my $element (@links) { my $all_internal = join("\n",@internal),"\n"; if (($element =~ m/$startingurl/i) && ($all_internal !~ m/$element/gi)) { print $element,"\n"; push (@internal, $element); } } }