m1k3y3
m1k3y3

Reputation: 2788

sed regular expression does not return expected results

I am trying to search for files which matches following expression with sed

[a-zA-Z0-9]{1,10}\s{1,5}\" 

after executing

sed -e '/\([a-zA-Z0-9]{1,10}\s{1,5}\"\)/!d' 

it does not give expected results

could one please assist ?

Upvotes: 0

Views: 76

Answers (1)

Andrew Clark
Andrew Clark

Reputation: 208475

In sed you need to escape the curly brackets for repetitions, try the following:

sed -e '/\([a-zA-Z0-9]\{1,10\}\s\{1,5\}\"\)/!d'

Here is a nice reference page on the sed regex syntax.

If this doesn't work, try replacing \s with [ \t\r\n]

Upvotes: 2

Related Questions