grep equivalent of the kwrite regex [A-Z][A-Z]+
2
votes
3
answers
11178
views
So, it took me ages, but I finally learned to *think* in terms of regular expressions, thanks to using them in
kwrite
.
But I still don't know how to translate that knowledge to grep
. I love my grep
, when I know what I'm doing with it, but the manual has always given me a headache.
I'd like to match stuff like the following lines:
CAPITALSFOLLOWING anewline. CAPI TALSFOLL owing ANEW line.That is, lines that begin with two or more capital letters. But I can't figure out how. In
kwrite
, I would match these lines using:
\n[A-Z][A-Z]+
But grep
... hmm. I have a feeling like it's something like:
me@ROOROO:~/$ grep "^[A-Z]something" filename
but
me@ROOROO:~/$ grep "^[A-Z][A-Z]+" filename
doesn't work (returns an empty file). A google search for the term 'grep match one or more occurrence' lead me to believe that
me@ROOROO:~/$ grep "^[A-Z][A-Z]*" filename
was the right syntax. But, alas, that doesn't do the trick.
Asked by ixtmixilix
(13520 rep)
Feb 10, 2012, 05:41 PM
Last activity: Aug 30, 2016, 12:53 PM
Last activity: Aug 30, 2016, 12:53 PM