syntax error near unexpected token `(' in bash

Viewed 2689

I want to use grep and a regular expression to search a text document. When I type in this:

grep -o ((D|d)ie|(D|d)as|(D|d)e(r|n|m|s)|(ei|Ei)(n|ne|nen|nem|ner|nes)) [A-ZÄÖÜ][A-Za-zäöü]* document.txt

I get this:

-bash: syntax error near unexpected token `('

I already tried to put the regular expression in quotation marks. By doing this, I don't get an error, but I don't find anything either. Thank you for helping me.

For example, the following sentence is in my document:

Der Mann und die Frau haben ein Haus.

I want to extract:

Der Mann
die Frau
ein Haus
1 Answers
Related