eggbaconsandwich
Programmer
Hi tek-tips.
Perl noob here, I have the following code for turning anything to lower case after 3 slashes :
Question, how can I quickly reverse the application of lc and only apply it to $1 instead of $2? I.e. turn anything to lower case up until finding 3 slashes, once 3 slashes found do not alter the rest.
Thanks in advance.
Perl noob here, I have the following code for turning anything to lower case after 3 slashes :
Perl:
$input = 'tea/coffee/eggs/BACON';
$output = $input =~ s/^((?:.*?\/){3}(.*)$/$1.lc($2)/er;
print $output;
Question, how can I quickly reverse the application of lc and only apply it to $1 instead of $2? I.e. turn anything to lower case up until finding 3 slashes, once 3 slashes found do not alter the rest.
Thanks in advance.