[pmwiki-devel] preg dot question...
The Editor
editor at fast.st
Fri Dec 8 04:01:53 CST 2006
Thanks again Pm! That was exactly what I needed! Now I understand
what was happening with several problems. Pattern matching is
starting to make sense.
One other more advanced question. In a markup like [+++ text +++], I
think I can get it to match, but is there are anyway to tell how many
plusses there are? As in 3 as opposed to 1 or 4? Also to make sure
there are the same number of +'s at beginning and end? Or is this
asking too much of regex?
$x = preg_replace(/\[\++(.*?)\++\]/, 'Function($1, $2)', $x);
$1 represents the number of +'s and $2 is the content between the delimiters.
Cheers,
Caveman
More information about the pmwiki-devel
mailing list