Perl Regex to search for ed2k links

C

cmw

Can anybody help me? I need a regex that extracts the ed2k:// links
from the below text. I am new to regex so i don't really know what i am
doing. Can anybody help.

I only want it to detect links that have eZebra\t before them. Can
anybody help?

Thanks

Example Text
------------

eZebra ------
troll
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x19.-.The.Damage.Done.(RTFM).AC3.2.0.avi|364597248|3CFACD8D441AA9EB03BF63958C674D16|/
wan !yesterday
eZebra [yesterday] (2005-02-05 +/- 4h, CST/GMT-6) new links
added: 36
(results in private msg window).
|<-- predx has left irc (Ping timeout)
eZebra --- Latest links: ---
eZebra
ed2k://|file|The.L.Word.-.1x03.-.Let's.Do.It.DVDrip.XviD-SAVANNAH.avi|367785984|55B0F21E816C22D4B68674DCD96E583D|/
eZebra
ed2k://|file|jonny.zero.104.whos.your.daddy.hdtv-lol.avi|358369280|01F96A3E710F645443A6A3133830D81F|/
eZebra
ed2k://|file|jonny.zero.s01e04.hdtv.xvid.proper-fqm.avi|366120960|7A94985989338D435998E453E84D6102|/
eZebra
ed2k://|file|MacGyver.s01e05.The.Heist.REPACK.DVDRip.XviD-MEDiEVAL.avi|366958592|5C3EC856C57389DDB294B32B9A36E0E6|/
eZebra
ed2k://|file|MacGyver.s01e04.The.Gauntlet.DVDRip.XviD-MEDiEVAL.avi|366446592|A08A1B9CCC74FC6F0A1E82CD1E4E35D8|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x22.-.Work.Related.(RTFM).AC3.2.0.avi|364687360|D36268345768CA9FD8C1ECA2F8F0D285|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x21.-.Scene.of.the.Crime.(RTFM).AC3.2.0.avi|364775424|339B35DE28552E0A416663A4540EB76C|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x20.-.The.Wedding.(RTFM).AC3.2.0.avi|364388352|9CBC843587017E08D4E7F207C1B48DD9|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x19.-.The.Damage.Done.(RTFM).AC3.2.0.avi|364597248|3CFACD8D441AA9EB03BF63958C674D16|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x18.-.Requiem.for.Adena.(RTFM).AC3.2.0.avi|364414976|391940769E2C7C133AD4C3F5BB1E4D4C|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x17.-.Map.of.the.Heart.(RTFM).AC3.2.0.avi|364865536|14C8C15189D8141F7EAD34A057947EBA|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x16.-.Stakeout.(RTFM).AC3.2.0.avi|364455936|321C7061687E6518332DD2295EE3616F|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x15.-.Justice.(II).(RTFM).AC3.2.0.avi|364781568|463FD7507112ECB5E5F3F5DFAD5780C0|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x14.-.Justice.(I).(RTFM).AC3.2.0.avi|364742656|D45F4C91D3ABDBFF735CBA11C6CDA048|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x13.-.I've.Got.a.Secret.(RTFM).AC3.2.0.avi|364410880|93D3FB12756C8831752B6A6FB770034F|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x12.-.The.Hat.(RTFM).AC3.2.0.avi|357390336|1552CE8BEB318DAFB896B2D7C4CADF7B|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x11b.-.For.God.and.Country.(2).(RTFM).AC3.2.0.avi|364519424|73B2B25D825CC154AB825629C0382340|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x11a.-.Charm.City.(1).(RTFM).AC3.2.0.(Previously.on.Law.&.Order.-.6x13).avi|7309312|C934EA6A5EABE39FCBAF
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x10.-.Full.Moon.(RTFM).AC3.2.0.avi|364388352|310BE9BCC64ECF022DE30B0D5534AA5B|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x09.-.Sniper.(II).(RTFM).AC3.2.0.avi|363542528|8851118EF7EBDD08423D5C1061441066|/
eZebra
ed2k://|file|Homicide.-.Life.on.the.Street.-.4x08.-.Sniper.(I).(RTFM).AC3.2.0.avi|364095488|5002EBAB39FCBBE1695CCBB16DC7693A|/
eZebra ------
Shanshu !list lost
 
G

Gunnar Hjalmarsson

Can anybody help me? I need a regex that extracts the ed2k:// links
from the below text. I am new to regex so i don't really know what i am
doing. Can anybody help.

Yes, you. You can help yourself:

perldoc perlrequick
perldoc perlretut
perldoc perlre

If you encounter problems after having given it a serious try, please
feel welcome to ask for help here.
 
C

Chris

I meant no offence. I just find regex tricky and whated to make sure i
got it right.

sorry.
 
G

Gunnar Hjalmarsson

[ Please provide context when you reply to another message. ]
I meant no offence.

I was not offended.
I just find regex tricky and whated to make sure i got it right.

Then it would be a good idea to show us what you have tried so far,
don't you think?
 
J

John Bokma

Chris said:
I meant no offence. I just find regex tricky and whated to make sure i
got it right.

What have you tried so far?

Also, if you want to print just lines containing a fixed string at a given
position you don't need regexp. See perldoc -f index.
 
D

David H. Adler

I meant no offence. I just find regex tricky and whated to make sure i
got it right.

Well, if that's what you want, you should show us what you've tried. :)

(also, some context in your posts would be nice. Take a look at the
posting guidelines for this group which are posted here periodically if
you haven't already.)

dha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,167
Messages
2,570,910
Members
47,453
Latest member
MadelinePh

Latest Threads

Top