2

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
8
  • 1
    grep -x '[aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz ]\+'
    – Costas
    Feb 12, 2015 at 17:49
  • can you please post this as answer? :)
    – user90825
    Feb 12, 2015 at 17:57
  • 1
    So, you mean "only lowercase letters and spaces", right? Feb 12, 2015 at 18:02
  • I removed the space from Costas answer, no space needed, thanks!
    – user90825
    Feb 12, 2015 at 18:07
  • only the letters needed.
    – user90825
    Feb 12, 2015 at 18:07

1 Answer 1

1
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

You must log in to answer this question.