Re: [PHP-DB] how to explain such a regular syntax

2010-08-12 Thread Peter Lind
On 13 August 2010 08:47, win.a wrote: > Its was picked from drupal source code and i don't know how does it works. > This is the code : > preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host); This has got nothing to do with php or php-db - your question is on regular expressions. Try consulting htt

[PHP-DB] how to explain such a regular syntax

2010-08-12 Thread win.a
Its was picked from drupal source code and i don't know how does it works. This is the code : preg_match('/^\[?(?:[a-z0-9-:\]_]+\.?)+$/', $host); After followed the regular syntax ,i try to cut it into pieces to make it simpler to understand , part a1: ^\[? part a2:([a-z0-9-:\]_]+\.?)+$ Then go o