Reply to Re: Trying to prevent duplicates in preg_replace Regex

Your name:

Reply:


Posted by Janwillem Borleffs on 02/25/07 11:14

erikcw wrote:
> Your selution is simple and elegant. Unfortunatly, it puts brackets
> around every line. I need it to ignore lines with "" around them, as
> well as line that start with a '-' and lines that end in a ** 0.00
> need the ending bracket before the **.
>

Perhaps with some fix up patterns:

$PATTERNS = array('/(\[|\])/', '/([^\r\n]+)/', '/(\["|"\])/',
'/(\[)\-(.+)(\])/',
'/(\[)(.+)([*]+)(.+)(\])/');
$REPLACEMENTS = array('', '[$1]', '"', '-$2', '[$2$3]$4');


JW

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация