fork(1) download
  1. #!/usr/bin/perl
  2. $regex = '<[^>]*|(a)';
  3. $subject = 'aig arother <a href="aaa">';
  4. ($replaced = $subject) =~ s/$regex/
  5. if (defined $1) {"b";} else {$&;} /eg;
  6. print $replaced . "\n";
Success #stdin #stdout 0s 3564KB
stdin
Standard input is empty
stdout
big brother <a href="aaa">