Saturday, March 8, 2014

SP2 - Regex basic quiz

Testing ..testing testing...will update this with detailed RegEx information and much more soon... Stay tuned. thank you...

Perl RegEx

Perl Basics RegEx quiz

  1. print "It matches\n" if "Hello World" =~ /World/; -- will it print?

  2. yes, it will print
    no, it wont print
    Error. print and regex cant be on the same line.

  3. $greeting = "world"; print "It matches\n" if "Hello World" REGEX; ...what will be REGEX here?

  4. =~ /"$greeting"/
    =~ /$greeting/i
    !~ /$greeting/i

  5. If you're matching against $_, the $_ =~ part can be omitted:

  6. true
    false
    depends

No comments:

Post a Comment