Reputation: 533
I have a set of strings in the form "UPPERCASE STRING Normal string"
. The uppercase part is made of different number of words (from 1 to 3), the second part sometime is absent. I am trying to separate those strings in two (es "UPPERCASE STRING" "Normal string")
but I am not a RegEx guru: who can help?
Upvotes: 0
Views: 71
Reputation: 91428
How about:
^([A-Z]+(?: [A-Z]+)+) (.*?)$
You'll have the uppercase words in group 1 and the rest in group 2
If you want to deal with any language:
^(\p{Lu}+(?: \p{Lu}+)+) (.*?)$
Upvotes: 1