I'm trying to find all lines that are all caps using regex, and so far I've tried this:
re.findall(r'\b\n|[A-Z]+\b', kaizoku)
So far my database is as follows:
TRAFALGAR LAW
You shall not be the pirate king.
MONKEY D LUFFY
Now!
DOFLAMINGO'S UNDERLINGS:
Noooooo!
I want it to return
TRAFALGAR LAW
MONKEY D LUFFY
DOFLAMINGO'S UNDERLINGS:
But it's returning something else. (Namely this:
TRAFALGAR
LAW
Y
MONKEY
D
LUFFY
N
DOFLAMINGO'
S
UNDERLINGS:
N
EDIT So far I really think the best fit for the answer is @Jan's answer
rx = re.compile(r"^([A-Z ':]+$)\b", re.M)
rx.findall(string)
EDIT2 Found out what's wrong, thanks!