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:
could you explain the meaning of the regex

 



per'l'over
Novice

Aug 27, 2008, 3:10 AM

Post #1 of 3 (1988 views)
could you explain the meaning of the regex Can't Post

could you explain the meaning of the regex

if($ARGV[0] =~ /^([\-+])/)


(This post was edited by ravindra on Aug 27, 2008, 3:36 AM)


KevinR
Veteran


Aug 27, 2008, 10:16 AM

Post #2 of 3 (1978 views)
Re: [per'l'over] could you explain the meaning of the regex [In reply to] Can't Post

it means that if the value of the variable $ARGV[0] begins with a - (dash) or a + (plus) the match is true, for example:

$ARGV[0] = '-foo'; #<-- matches true
$ARGV[0] = '+foo'; #<-- matches true
$ARGV[0] = 'foo';#<-- matches false
-------------------------------------------------


per'l'over
Novice

Aug 27, 2008, 9:10 PM

Post #3 of 3 (1962 views)
Thanks Kevin [In reply to] Can't Post

 

 
 


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

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