develooper Front page | perl.beginners | Postings from February 2002

Re: Matching text

Thread Previous
From:
Kevin Hancock
Date:
February 1, 2002 16:51
Subject:
Re: Matching text
Message ID:
200202020051.g120pKx22646@mailman.arcom.com.au

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 puts the nonspace cars, ie the
> username in $1 since we hve the () around that part.
>
> you should read the documentation at 'perldoc perlre' and/or read books
> about perl. My guess is that it'd take you 5 mins of reading in learning
> perl to solve this problem.
>

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About