my $x = "foobar"=~/[aeiou]/; # => $x is true my $y = "foobar"=~/[xyz]/; # => $y is false #### my $str = "foobar"; my $x = $str=~/[aeiou]/g; # matches first "o" => $x is true, pos($str) is 2 $x = $str=~/[aeiou]/g; # matches second "o" => $x is true, pos($str) is 3 $x = $str=~/[aeiou]/g; # matches "a" => $x is true, pos($str) is 5 $x = $str=~/[aeiou]/g; # no more matches => $x is false, pos($str) is undef #### my ($x) = "foobar"=~/[aeiou]/; # => $x is 1 #### my ($x,$y,$z) = "foobar"=~/[aeiou]/g; # => $x is "o", $y is "o", $z is "a" #### my ($x,$y) = "foobar"=~/([aeiou])(.)/; # => $x is "o", $y is "o" #### my ($w,$x,$y,$z) = "foobar"=~/([aeiou])(.)/g; # => $w is "o", $x is "o", $y is "a", $z is "r" #### my $x = "foobar"; my $y = $x=~s/[aeiou]/x/g; # => $y is 3 #### my $x = "foobar"=~s/[aeiou]/x/gr; # => $x is "fxxbxr" #### my ($value) = $row =~ /.*,(.*)/; # and $row =~ s/,[^,]*$//; #### use Regexp::Common qw/number/; my $row = "a,b,c,d,15"; if ( $row=~s/,($RE{num}{real})$// ) { print "matched <$1>\n"; } print "row is now <$row>\n"; __END__ matched <15> row is now