SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Jan 13, 2005, 02:08 #1
- Join Date
- Sep 2004
- Location
- Baton Rouge, La
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
regex matching across mutliple lines
I am trying to match some text inside html comments using a regular expression.
Im trying to get "thumbnails" out then also
HTML Code:<div class="thumbnail"> <a href="gallery.php?gallery=%[GALLERY]&image=%[IMAGE]"> <img src="%[IMAGEURL]" class="thumbnail" alt="%[CAPTION]" style="top: " /> </a> <a href="gallery.php?gallery=%[GALLERY]&image=%[IMAGE]" class="caption">%[CAPTION]</a> </div>
HTML Code:<!-- section:thumbnails <div class="thumbnail"> <a href="gallery.php?gallery=%[GALLERY]&image=%[IMAGE]"> <img src="%[IMAGEURL]" class="thumbnail" alt="%[CAPTION]" style="top: " /> </a> <a href="gallery.php?gallery=%[GALLERY]&image=%[IMAGE]" class="caption">%[CAPTION]</a> </div> -->
Once you eliminate the impossible, whatever remains,
no matter how improbable, must be the truth.
-
Jan 13, 2005, 06:23 #2
- Join Date
- Jun 2003
- Location
- Iowa, USA
- Posts
- 3,749
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:preg_match('~<!--\s+section:thumbnails(.*?)-->~ms', $content, $matches);
Jason Sweat ZCE - jsweat_php@yahoo.com
Book: PHP Patterns
Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
Detestable (adjective): software that isn't testable.
Bookmarks