POV-Ray : Newsgroups : povray.off-topic : When all else fails ... Server Time
1 Nov 2024 13:22:04 EDT (-0400)
  When all else fails ... (Message 1 to 1 of 1)  
From: Jim Holsenback
Subject: When all else fails ...
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.