www\" rel="nofollow">www\. |http:\/\/|www\" rel="nofollow">www\" rel="nofollow">www\. )(?:youtube\. Com..." />

PHP Regex for different URLs?

Here you go: (?:http:\/\/www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\. |http:\/\/|www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\. )(?:youtube\.

Com\/watch\? V=(?:\w+)|domain\. Com\/image.(?:jpg|png|gif)|domain\.

Com) Or with delimiters: ~(?:http:\/\/www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\. |http:\/\/|www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\" rel="nofollow">www\. )(?:youtube\.

Com\/watch\? V=(?:\w+)|domain\. Com\/image.(?:jpg|png|gif)|domain\.

Com)~i You can test the above RegExs @ Robular. To find out if the URLs are inside unwanted HTML tags I suggest you use a DOM parser. Also, check out this related question: How to mimic StackOverflow Auto-Link Behavior.

Regarding the YouTube replacement you can do something like this: echo preg_replace('~youtube\. Com\/watch\? V=(\w+)~i', 'embed code $1', $comments'message').

This is quite straight-forward. Anyways +1 for compiling it correctly :-P – Boldewyn Jan 11 '10 at 7:40.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions