POV-Ray : Newsgroups : povray.off-topic : When all else fails ... : When all else fails ... Server Time
29 Jul 2024 14:20:08 EDT (-0400)
  When all else fails ...  
From: Jim Holsenback
Date: 9 Aug 2011 16:55:16
Message: <4e419eb4$1@news.povray.org>
... try the opposite!

I'm back having a look at wikidocgen and doing some housekeeping. I've 
been struggling with left over newlines after a pattern match. When the 
PHP manual failed to get me going I tried searching for ways of 
eliminating those pesky leftovers. Well all my findings didn't tell me 
anything I didn't already know or already tried ... then I stumbled upon 
"How to preserve newline when using preg_replace?" which is the opposite 
of what I wanted to do ... careful examination of their code snippet led 
me to a fix:

$Pattern = '<!-{2}<indexentry ([a-zA-Z0-9 \"\/:+,.#_-]+)>-{3}>';

becomes

$Pattern = '<!-{2}<indexentry ([a-zA-Z0-9 \"\/:+,.#_-]+)>-{3}>([\s]+)';

Hows that for thinking outside the box!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.