0

I have a string formatted like this:

Meaningless Garbage I Don't Want INFO I'M LOOKING FOR

The meaningless garbage and the info I'm looking for are of variable length, however the info I'm looking for will always be in uppercase, and the other stuff will always be in title case.

Is there any way at all to separate it with a regular expression? I'm not very good at regex, so I don't know what's possible.

1
echo "Meaningless Garbage I Don't Want INFO I'M LOOKING FOR" | grep -Eo -e '\b[A-Z'\'']{2,}\b'
INFO
I'M
LOOKING
FOR
0

Assuming the title case will ALWAYS end in a lower case letter, try

sed 's/^.*[a-z] //' file
INFO I'M LOOKING FOR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy