I'd like to ask another question, which is a bit like the reversal of
the former:

I like to fix orphaned @] and =] strings in a text row, i.e.
if no previous [= or [@ is found to a =] or @]
then I like to add the corresponding [= or [@ to the beginning of the
row.

I found one solution involving two preg_match expressions,
the first checks if the row has no [...@.....@] or [=....=],
the second than checks for a @] or =],
but I hope there is a simpler way than this:

if(!preg_match("/\\[([...@])(.*?)\\1\\]/", $row)
   && preg_match("/([...@])\\]/", $row, $m))
        $row = "[".$m[1].$row;


Thanks!

Hans


_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to