0
I want to print whole record if it contain word and some character, which are optional. Script:
/mount[ein]{0,2}/{
print $0}
Unfortunately it doesn't work. Without "{" and "}" it work. I tried with "\" befor "{":
/mount[ein]\{0,2\}/{
print $0}
Other example. For file:
mountx
mounte
mountee
mounteee
Awk:
awk '/mount[ein]{0,2}$/' file
And result:
//nothing
System: Debian 7.8 Linux ibm 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux
Show your input and desired output. – John1024 – 2015-08-29T19:05:25.433
Input is a text (part of book). I only want to know why regex doesn't work. Are {} don't work in awk. – diego9403 – 2015-08-29T19:21:49.537
1What makes you believe the regex doesn't work? Without telling the input, the expected output and the actual output, it's hard for us to guess. – jlliagre – 2015-08-29T19:53:50.340