1 | <?php |
||
5 | class UrnValidator |
||
6 | { |
||
7 | const URN_REGEXP = '/^urn:[a-z0-9][a-z0-9-]{1,31}:([a-z0-9()+,-.:=@;$_!*\']|%(0[1-9a-f]|[1-9a-f][0-9a-f]))+$/i'; |
||
8 | |||
9 | /** |
||
10 | * Validate a URN according to RFC 2141. |
||
11 | * |
||
12 | * @param string $urn the URN to validate |
||
13 | * |
||
14 | * @return bool TRUE when the URN is valid, FALSE when invalid |
||
15 | */ |
||
16 | public static function validate($urn) |
||
20 | } |
||
21 |