# method 1 print qq{@{[ map { ucfirst} $c =~ /([^_]+)/g ]}}; # method 2 $c =~ s/([^_]+)|_/ucfirst $1 or ' '/ge; print "$c\n"; # method 2 - updated version # just realized there might be a problem if the pattern # $c = '0_a_c_code', where 0 also evaluates to false $c =~ s/([^_]+)|_/defined($1) ? ucfirst $1 : ' '/ge; print "$c\n";
In reply to Re: split and capitalize regex
by Roger
in thread split and capitalize regex
by arc_of_descent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |