in reply to Re: Extract firstname and lastname from variable
in thread Extract firstname and lastname from variable

This one absolutely good:
/^([A-Z][a-z]+)([A-Z]+)?([A-Z][a-z]+)?$/ # stored in $1, $2, $3
it works with:
FooBBBBar FooBar Foo