CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [NuclearClam] Simple regex problem: Edit Log



Paul
Enthusiast

Aug 7, 2002, 2:17 AM


Views: 9683
Re: [NuclearClam] Simple regex problem

>>
why doesn't [1] return "cabbage"? does it only match things once and put it into one element? if so, what's the point?
<<

....because it is matching a space followed by one or more a-z0-9_ followed by a comma so the first occurance is "bananas".....what's the point?...ask the regex author :)


>>
why does this return 'in1' instead of just 'in'?
<<

Because you are printing the subroutine as well as printing shift.

Try:


Code
$blah = q(magic%jellybeans%have%sprouted%in%my%head);     

print bars('in');

sub bars { shift }


I'm not sure of the relevance of $blah in that example Cool


(This post was edited by RedRum on Aug 7, 2002, 2:19 AM)


Edit Log:
Post edited by Paul (Enthusiast) on Aug 7, 2002, 2:18 AM
Post edited by Paul (Enthusiast) on Aug 7, 2002, 2:19 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives