Help for this page

Select Code to Download


  1. or download this
    "(?=hello)" matches "hello"
    ".*"        matches "hello Ga"
    "[^G]"      matches "g"
    "[^a]"      matches "s"
    ".*"        matches nothing
    
  2. or download this
    ( "hello Gags" =~ /^(?=hello)(?!.*Ga/ )&& print ("Matched") || print (
    +"Unmatched")
    
  3. or download this
    use strict;
    ( "hello Gags" =~ /^(?=hello)(.*)([^G][^a])(.*)$/ ) ?  matches() : pri
    +nt ("Unmatched");
    ...
    $1 = 'hello Ga'
    $2 = 'gs'