#!/usr/bin/perl
use strict;
use warnings;
###############
#
# Playing with regex's
#
################

my $string = "One one oNe";
print "string is '$string'\n";
$string =~ s/one/two/ig;
print "s/one/two/i gives '$string'\n";

# -------------

# This is from perl monks, 
# using the binary XOR ^ operator.
# I'm assuming that $new is already lowercase.

$string = "One one oNe";
my $old = "one";
my $new = "two";
print "string is '$string'\n";
$string =~  s/(one)/'two'^$1^lc$1/gie;
print "s/(one)/'two'^\$1^lc\$1/gie gives '$string'\n";


