Page 2 of 2

Posted: Sat Apr 16, 2005 11:19 am
by feyd
preg_match_all() is about the only way to do it accurately, in an easier manor unless you have identifying marks on either end you can easier search for like in your last example. The only problem is, the markings must match exactly somehow.. not so fun to type when coding. Which is why using a more simple syntax and using preg_match_all() works well... if you must really get the block of data inside the tags..

a lexical parser wouldn't need that much information, typically.

Posted: Sun Apr 17, 2005 10:08 am
by vigge89
But the question still lies; How would the pattern to match tags with the same key work? Sorry, but I can't find any way to do it myself :(

Posted: Sun Apr 17, 2005 12:49 pm
by feyd

Code: Select all

#<pre-first-key(key)post-first-key>(.*?)<pre-next-key\\1post-next-key>#is