I am trying to check an uppercase letter that has a lowercase letter immediately following it. The trick is that there will be a bunch of garbage caps and a quantity in front. For instance:
AASKH317298DIUANFProgramming is fun
as you can see, there are tons of things that we donβt need, right before the phrase we need, Programming is fun .
I am trying to use regex for this, taking each line and then replacing it with '' , since the original line does not need to be saved.
re.sub(r'^[A-Z0-9]*', '', string)
The problem with this code is that it leaves us with rogramming is fun , since P is uppercase.
As I will check, to make sure that if the next letter is lowercase, then I must leave this capital intact. ( P in Programming )
source share