in reply to Re: Search for a character in CAPS
in thread Search for a character in CAPS
I realize that spaces within the string is probably outside the scope of the original question, but \B covers his bases and might be a little easier for a beginner to grok than a look-ahead.$agent = 'PerlBeginnerPerl AndAnother'; $agent =~ s/\B([A-Z])/ $1/g; # Produces 'Perl Beginner Perl And Another' $agent = 'PerlBeginnerPerl AndAnother'; $agent =~ s/\B([A-Z])/ $1/g; # Produces 'Perl Beginner Perl And Another'
-- grummerX
|
|---|