Reply to Re: [PHP] expression between vertical bars

Your name:

Reply:


Posted by Richard Lynch on 05/09/05 05:01

On Fri, May 6, 2005 12:25 pm, Jan said:
> Could someone explain to me the use of the vertical bar in
> expressions like "|<[^>]+>(.*)</[^>]+>|U". I understand that the
> vertical bars are used to separate the expression from the modifier,
> but can't find any documentation about the reasons and rules to do
> this.

The rule is that the first character, whatever it is, is THE character to
mark beginning and end of the expression.

The following are all the SAME:
"|<[^>]+>(.*)</[^>]+>|U"
"?<[^>]+>(.*)</[^>]+>?U"
"X<[^>]+>(.*)</[^>]+>XU"

/ is a common character to use, but he needed / in his expression, so he
picked | instead.

http://php.net/pcre

--
Like Music?
http://l-i-e.com/artists.htm

[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

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