1

Question: How can I grep for lines that ONLY have the following characters (all in lowercase)?

aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz

example:

INPUT:

árvíztűrő tükörfúrógép
árvíztűrő tü3körfúrógép
"árvíztűrő tükörfúrógép

OUTPUT:

árvíztűrő tükörfúrógép
  • 1
    grep -x '[aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz ]\+' – Costas Feb 12 '15 at 17:49
  • can you please post this as answer? :) – user90825 Feb 12 '15 at 17:57
  • 1
    So, you mean "only lowercase letters and spaces", right? – Scott Feb 12 '15 at 18:02
  • I removed the space from Costas answer, no space needed, thanks! – user90825 Feb 12 '15 at 18:07
  • only the letters needed. – user90825 Feb 12 '15 at 18:07
0
grep -x '[aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz ]\+'
  • -x match pattern to whole line
  • [...] list of symbols to match
  • + symbol should present at least one

Your Answer

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