This seems to work.
$s = 'the_quick_brown_fox_jumps_over_the_lazy_dog'; $s =~ s[(.)([^_]*?)(?:_|$)][\U$1\E$2 ]g; print $s; The Quick Brown Fox Jumps Over The Lazy Dog $s = 'fred'; $s =~ s[(.)([^_]*?)(?:_|$)][\U$1\E$2 ]g; print $s; Fred
In reply to Re: split and capitalize regex
by BrowserUk
in thread split and capitalize regex
by arc_of_descent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |