Fooling around with regex

| | Comments (0) | TrackBacks (2)

Yesterday out of boredom I started playing with Regex (Regular Expressions). I somehow got carried away and found that regex is actually fun once you learn it. It's like playing chess, all the strategy you have to do to match and process your text is part of winning over content.

Well, what I did is pretty little, that is converting plain urls like

http://www.youtube.com/watch?v=PF-cXjxgREQ

To

It also supports links with http://au.youtube.com/watch?v=PF-cXjxgREQ and so on. Of course youtube alone wasn't enough so I threw at it Metacafe, revver, dailymotion, vimeo support.

Of course, an issue came up with dailymotion, that is the way the "categorize", so the URL is affected and it only works with Permalinks. I'm currently working on a fix that might actually fix the redundancy of "/section/section/section/".

Try the parser, live!
Paste links like

http://www.youtube.com/watch?v=pkuLh4u0H8E
http://www.dailymotion.com/video/x5qbhc_99-dreams_shortfilms
http://www.metacafe.com/watch/1269694/trick_shot_masters/
http://revver.com/video/1076971/sexy-fitness-break-tight-glutes/
http://vimeo.com/707539

Paste them inside the textarea :) (of course!) Anyway, this will be available under New BSD License as soon as I finish a few things.

I'm still new at regex! Can't wait to master it soon :)

2 TrackBacks

Listed below are links to blogs that reference this entry: Fooling around with regex.

TrackBack URL for this entry: http://routecafe.com/cgi-bin/dashboard/mt-tb.cgi/18

rachel ray recipes from rachel ray recipes on November 27, 2008 2:00 PM

rachel ray recipes Read More

ln52a650 lcd Read More

Leave a comment

About this Entry

This page contains a single entry by David published on August 3, 2008 7:20 AM.

Digg.com phailing? was the previous entry in this blog.

videoCast PHP Parser is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1