2

I am having trouble writing a REGEX for my grep command. I have a bunch of html pages that need to be searched to find all youtube.com links. More importantly, I only need those youtube links that don't end with rel=0.

For example:

http://www.youtube.com/(something)_rel=0    [i have a regex for this]

http://www.youtube.com/(something)          [i need this one]

Is this possible?

Martin Ender
  • 43,427
  • 11
  • 90
  • 130

1 Answers1

0

Use this grep:

grep -i "youtube\." infile | grep -iv "rel=0$"
anubhava
  • 761,203
  • 64
  • 569
  • 643