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 :)

Leave a comment