change this:

preg_match_all('#<youtube>(.*?)</youtube>#i', $content, $link_matches);

to this:

preg_match_all('#<youtube>(.*?)<\/youtube>#i', $content, $link_matches);

if it still won't work... then post the error which you get.
sloddl Reviewed by sloddl on . php help regex! i have to do a simple work i have to find all <youtube>v=xxxxxx</youtube> in post of a wordpress and replace then custom way! function the_content($more_link_text = null, $stripteaser = 0) { $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters('the_content', $content); Rating: 5