Simon Heimlicher
 
  
 

Regex Tricks

In-place Operations

Substitution

my $str = 'aaaabbbbccc';
$str =~ s/a/x/g;

Matching

my $str = 'aaaabbbbccc';
($a, $b, $c) = ($str =~ /(a+)(b+)(c+)/);

Discussion

Enter your comment
ALICD