Search code examples
regexembedsrc

Regex To Get Embed SRC


I'm trying to write a PHP function that will scan the $content for an tag and return the SRC url.

I've tried:

<embed.+?src="(.+?)".+?<\/embed>

But I get:

Warning: preg_match_all() [function.preg-match-all]: No ending matching delimiter '>' found


Solution

  • preg_match or preg_match_all need a delimiter

    try: /<embed.+?src="(.+?)".+?<\/embed>/