- or download this
my $x = "foobar"=~/[aeiou]/; # => $x is true
my $y = "foobar"=~/[xyz]/; # => $y is false
- or download this
my $str = "foobar";
my $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
- or download this
my ($x) = "foobar"=~/[aeiou]/; # => $x is 1
- or download this
my ($x,$y,$z) = "foobar"=~/[aeiou]/g;
# => $x is "o", $y is "o", $z is "a"
- or download this
my ($x,$y) = "foobar"=~/([aeiou])(.)/;
# => $x is "o", $y is "o"
- or download this
my ($w,$x,$y,$z) = "foobar"=~/([aeiou])(.)/g;
# => $w is "o", $x is "o", $y is "a", $z is "r"
- or download this
my $x = "foobar";
my $y = $x=~s/[aeiou]/x/g; # => $y is 3
- or download this
my $x = "foobar"=~s/[aeiou]/x/gr;
# => $x is "fxxbxr"
- or download this
my ($value) = $row =~ /.*,(.*)/;
# and
$row =~ s/,[^,]*$//;
- or download this
use Regexp::Common qw/number/;
...
matched <15>
row is now <a,b,c,d>