Ricardo Pichler wrote:
> I need replace in my string the characters in
> upperCase for the same but preceding the simbol +.
> s/.../.../g; # to do this return "+Ricardo+Pichler";
> but like this:
> but this donīt work.
You are attempting to use a character class as a replacement string
which you don't want to do.... You would need something such as:
my $string = 'RicardoPichler';
$string =~ s/([A-Z])/\+$1/g;
This uses "capturing parentheses" to catch the character you want, in
this case anything in the upper cased ...