php-general | 2005051
Date: 05/08/05
- Next message: Richard Lynch: "Re: [PHP] array diff with both values returned"
- Previous message: The Doctor: "Re: [PHP] Question about acessing databases and formatting output"
- In reply to: Jan: "[PHP] expression between vertical bars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
-- Like Music? http://l-i-e.com/artists.htm-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Richard Lynch: "Re: [PHP] array diff with both values returned"
- Previous message: The Doctor: "Re: [PHP] Question about acessing databases and formatting output"
- In reply to: Jan: "[PHP] expression between vertical bars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

