I'm using Regexp::Common:rofanity to filter out profanity from user submitted data... I want to replace all occurrences of profanity with the appropriate # of asterisks...
A four letter word ends up being: "****". Here's the start of what I have, but syntactically it's incorrect.
$noprof =~ s/$RE{profanity}/*{length($`)}/gi;
I think length($`) gives me the length of the match... but how do I repeat the asterisks length number of times?
A four letter word ends up being: "****". Here's the start of what I have, but syntactically it's incorrect.
$noprof =~ s/$RE{profanity}/*{length($`)}/gi;
I think length($`) gives me the length of the match... but how do I repeat the asterisks length number of times?