For query $pat highlighting I use the following preg_replace on text
lines $row:

$row = preg_replace("/([EMAIL PROTECTED])($pat)([EMAIL PROTECTED])/".$qi."", 
"[EMAIL PROTECTED]@$3", $row);

$row = preg_replace("/($pat)/".$qi."","'''$1'''", $row);

The second surrounds the query match with ''' to create a  bold
highlight markup.

The first looks for any [@ .... querymatch .... @] and converts it into

  [@ .... @]querymatch[@ .... @]
  
in order for the '''bold highlight''' to work.

This is fine except in situations where there are several matches
inside the [@ .... @] brackets:
[@ ... match ... match ... @]

What regex do I need to cover these cases as well?
  
Thanks for any ideas!

Hans



_______________________________________________
pmwiki-devel mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to