I guess this would be a rather long regular expression, but is there a way to takeout underscores, spaces, commas, and hyphens from a string and then join the words together in perl?
Example:
_Car - Eat, Tree
Becomes:
CarEatTree
You can use a simple substitution:
$string =~ s/[_ ,-]//g;
This can also be done without regular expressions: Transliterate: tr///
use warnings;
use strict;
my $s = '_Car - Eat, Tree';
$s =~ tr/_ ,\-//d;
print "$s\n";
__END__
CarEatTree
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With