I know my opinion on this really isn't that popular so you guys can down-vote me into oblivion if you want, but I have to rant a little (and this contains an solution, just not in the way the poster asked for).
I really don't get why people go to regular expressions so quickly.
I've done a lot of string parsing (Used to screen-scrape vt100 menu screens) and I've never found a single case where Regular Expressions would have been much easier than just writing code. (Maybe a couple would have been a little easier, but not much).
I kind of understand they are supposed to be easier once you know them--but you see someone ask a question like this and realize they aren't easy for every programmer to just get by glancing at it. If it costs 1 programmer somewhere down the line 10 minutes of thought, it has a huge net loss over just coding it, even if you took 5 minutes to write 5 lines.
So it's going to need documentation--and if someone who is at that same level comes across it, he won't be able to modify it without knowledge outside his domain, even with documentation.
I mean if the poster had to ask on a trivial case--then there just isn't such thing as a trivial case.
public String getRealText(String scanMe) {
for(int i=0 ; i < scanMe.length ; i++)
if( isUpper(scanMe[i]) && isLower(scanMe[i+1]) )
return scanMe.subString(i);
return null; }
I mean it's 5 lines, but it's simple, readable, and faster than most (all?) RE parsers. Once you've wrapped a regular expression in a method and commented it, the difference in size isn't measurable. The difference in time--well for the poster it would have obviously been a LOT less time--as it might be for the next guy that comes across his code.
And this string operation is one of the ones that are even easier in C with pointers--and it would be even quicker since the testing functions are macros in C.
By the way, make sure you look for a space in the second slot, not just a lower case variable, otherwise you'll miss any lines starting with the words A or I.