I have a sentence like:
Name: JOHN J. SMITH Sometag:
How would I grab the JOHN J SMITH part?
Sometag is not always the same so it would be more like get all all-capitalized words until one that is not.
UPDATE
"[A-Z. ]*" returns JOHN J. SMITH S
"[A-Z. ]*\b" returns nothing as well as
"\b[A-Z. ]*\b"
Try this
Let me know how it goes
You can be be more complete with this one
But its a mouthful
Or shorter
Update 1
After your edit I would use this
The desired match will be in group 1. Note that I added a [ ] in the end so to signal a single space. You can convert this character class to a space if you want.
In C# this becomes