CrazyMax
CrazyMax

Reputation: 801

Sed regex does not work

The following command does not return anything and i think my regex is good ?

echo 'The.Big.Bang.Theory.S07E01.VOSTFR.720p.WEB-DL.DD5.1.H.264-GKS.mkv' |\
sed -n '/The.Big.Bang.Theory*VOSTFR*720p*WEB-DL*.mkv/p'

Thanks!

Upvotes: 0

Views: 80

Answers (3)

CrazyMax
CrazyMax

Reputation: 801

Works like this :

echo 'The.Big.Bang.Theory.S07E01.VOSTFR.720p.WEB-DL.DD5.1.H.264-GKS.mkv' |\
sed -n '/The.Big.Bang.Theory.*VOSTFR.*720p.*WEB-DL.*.mkv/p'

I forgot the dots :/

Upvotes: 0

user1907906
user1907906

Reputation:

y* means zero or more ys. R* means zero or more Rs. etc.

You probably want

/The\.Big\.Bang\.Theory.*VOSTFR*720p.*WEB-DL.*\.mkv/

Upvotes: 0

user278064
user278064

Reputation: 10170

  • \. matches the . char
  • .* matches any char zero or more times:

    sed -n '/The\.Big\.Bang\.Theory.*VOSTFR.*720p.*WEB-DL.*\.mkv/p'

Upvotes: 2

Related Questions