[Pmwiki-users] Re: null characters or pattern breaking characters

Patrick R. Michaud pmichaud
Mon Jan 12 18:42:01 CST 2004


On Tue, Jan 13, 2004 at 01:31:18PM +1300, John Rankin wrote:
> 13 January 2004 12:15 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > An implementation suggestion:  If you're going to define a multi-character
> > sequence to indicate "non-rendering markup stop", then perhaps it'd make
> > implementations easier if early in PmWiki's processing the multi-character 
> > sequence is converted into a single non-printing character before
> > any other processing takes place.  [...]
> 
> Good point (as always).
> 
> While I hadn't really thought through implementing this, I had expected in 
> my examples to do something like:
>     $text = preg_replace("/`\\.(.*?)$/","",$text);
> or the longer
>    if (strstr($text,'`.')) $text = substr($text,0,strpos($text,'`.'));

Oh, these work very well also, since you're only interested in cutting
things up to the first stop.  Good point.  :-)

> In the cases where one wants to stop a pattern match, like Christian's
> URI inside a || ... || or a @@ ... @@, the ` alone should be enough to
> stop the pattern, given the change you proposed earlier.

Yeah, I'm not sure what to do about that change--I'm waiting to see if
others have opinions on that.

Pm



More information about the pmwiki-users mailing list