You are here: regex for preg_split « PHP Programming Language « IT news, forums, messages
regex for preg_split

Posted by Tom on 01/25/07 04:19

A puzzle for you regular expression wizards out there.

Looking for a regex that will split up a string like the following on
any pipe (|) not inside brackets:

a b | a { b |{c | cd}} d | a b c

Correct result would be:

array ( [0] => 'a b', [1] => 'a { b |{c | cd}} d', [2] => 'a b c')

I've found a couple that get close, but nothing that quite does what
I'd like.

(Or is this better handled without regex?)

Thanks,
Tom

 

Navigation:

[Reply to this 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

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