[pmwiki-users] pattern matching question...

The Editor editor at fast.st
Fri Mar 16 09:22:47 CDT 2007


In order to help with downward compatibility on ZAPbeta 2007-03, I'm
trying to set up a pattern that will match something like this:

Field="Value"

if the normal PTV function finds nothing.  Given the field name is
$var, I'd like to be able to do something like:

	$var = PageTextVar($page, $var);
	if ($var == '') {
		$page = ReadPage($page);
		$var = preg_replace('/'$var'\\=\\"(.*?)\\"/s',"$1", $page['text']);
		}

It seems to be close to matching the pattern cause it does something
strange on the page text, but I don't want to change the page text, I
want to simply extract the $var value from the page and assign it to
$var.  Can someone explain what function to use to do this?  TIA!

Cheers,
Dan



More information about the pmwiki-users mailing list