Writing "xxx" OR "yyy" with a regular expressions`?

From: Date: Wed, 12 Dec 2001 19:06:55 +0000
Subject: Writing "xxx" OR "yyy" with a regular expressions`?
Groups: php.general 
Request: Send a blank email to php-general+get-77468@lists.php.net to get a copy of this message
Hello there, I need to write all of the href="" contents into an array. Presently I use the following code, which works like charm: <.CODE>preg_match('!HREF=[\"\' ]{0,}([^\"\'>]*)[\"\'>]!i', $Content, $reg_array)<./CODE> That, however, doesn't support Frames so I would need to make the script match "HREF" or "SRC". I tried the following code, but it doesn't want to support frames and ceases to support usual HREF's as well. <.CODE>preg_match('!(HREF|SRC)=[\"\' ]{0,}([^\"\'>]*)[\"\'>]!i', $Content, $reg_array)<./CODE> In other words I replace <.CODE>HREF<./CODE> with <.CODE>(HREF|SRC)<./CODE>. Any ideas how to make the script support both? Yours, Lauri -- Tharapita Creations [dynamic web applications] lauri.vain@tharapita.com Mobile: +372 53 401 312

« previous php.general (#77468) next »