Help for this page

Select Code to Download


  1. or download this
    #Sample strings in an array:
    
    my @a = ('SystemMaj', 'MemoryCrit','ServerOkay', 'MemoryOkay');
    
  2. or download this
    #code sample
    my @a = ('SystemMaj', 'MemoryCrit','ServerOkay', 'MemoryOkay');
    ...
        $v =~ m/(\w+[^(?:Crit|?:Maj|?:Okay])(\w+)/;
        print "1: $1  2:$2\n";
    }
    
  3. or download this
    #sample output
    1: System  2:Maj #correct
    1: Memo  2:ryCrit #should be 1: Memory 2: Crit
    1: Serve  2:rOkay #should be 1: Server 2: Okay
    1: Memo  2:ryOkay #should be 1: Memory 2: Okay