Let's say I'm trying to match a URL with regular expressions:
$text = 'http://www.google.com/';
$text =~ /\bhttp:\/\/([^\/]+)/;
print $1; # It prints www.google.com
I would like to replace the pattern it matches with one space for each character in it. For instance, considering the example above, I would like to end up with this text:
# http:// /
Is there a simple way to do this? Finding out how many characters the matched pattern has and replacing it with the same number of different characters?
Thank you.