Help for this page

Select Code to Download


  1. or download this
    $line = "She was very absorbed in her homework.";
    $word = "absorb";
    ...
    $line =~ s/($word(?:s|ed))/<b>$1<\/b>/igm;
    print STDOUT "New Line: $line\n";
    print STDOUT "\$1 contains: $1\n";
    
  2. or download this
    $line =~ s/\b(${word}(?:s|ed)?)\b/<b>$1<\/b>/igm;