in reply to Re: Search for a character in CAPS
in thread Search for a character in CAPS

Conversely, you could use \B to match a non-boundary. This would still take into account the beginning of the string, while also allowing for spaces within the string.
$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'
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.

-- grummerX