Verzeichnisstruktur phpBB-3.0.0


Veröffentlicht
12.12.2007

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

regex.php

Zuletzt modifiziert: 09.10.2024, 12:50 - Dateigröße: 2.47 KiB


01  <?php
02  //
03  // Security message:
04  //
05  // This script is potentially dangerous.
06  // Remove or comment the next line (die(".... ) to enable this script.
07  // Do NOT FORGET to either remove this script or disable it after you have used it.
08  //
09  die("Please read the first lines of this script for instructions on how to enable it");
10   
11   
12  // IP regular expressions
13   
14  $dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])';
15  $h16 = '[\dA-F]{1,4}';
16  $ipv4 = "(?:$dec_octet\.){3}$dec_octet";
17  $ls32 = "(?:$h16:$h16|$ipv4)";
18   
19  $ipv6_construct = array(
20      array(false,    '',        '{6}',    $ls32),
21      array(false,    '::',    '{5}',    $ls32),
22      array('',        ':',    '{4}',    $ls32),
23      array('{1,2}',    ':',    '{3}',    $ls32),
24      array('{1,3}',    ':',    '{2}',    $ls32),
25      array('{1,4}',    ':',    '',        $ls32),
26      array('{1,5}',    ':',    false,    $ls32),
27      array('{1,6}',    ':',    false,    $h16),
28      array('{1,7}',    ':',    false,    '')
29  );
30   
31  $ipv6 = '(?:';
32  foreach ($ipv6_construct as $ip_type)
33  {
34      $ipv6 .= '(?:';
35      if ($ip_type[0] !== false)
36      {
37          $ipv6 .= "(?:$h16:)" . $ip_type[0];
38      }
39      $ipv6 .= $ip_type[1];
40      if ($ip_type[2] !== false)
41      {
42          $ipv6 .= "(?:$h16:)" . $ip_type[2];
43      }
44      $ipv6 .= $ip_type[3] . ')|';
45  }
46  $ipv6 = substr($ipv6, 0, -1) . ')';
47   
48  echo 'IPv4: ' . $ipv4 . "<br />\nIPv6: " . $ipv6 . "<br />\n";
49   
50  // URL regular expressions
51   
52  $pct_encoded = "%[\dA-F]{2}";
53  $unreserved = 'a-z0-9\-._~';
54  $sub_delims = '!$&\'()*+,;=';
55  $pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|"
56   
57  $scheme = '[a-z][a-z\d+\-.]*';
58  $reg_name = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" and no ":" (included instead of userinfo)
59  //$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
60  $ipv4_simple = '[0-9.]+';
61  $ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]';
62  $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)";
63  $port = '\d*';
64  //$authority = "(?:$userinfo@)?$host(?::$port)?";
65  $authority = "$host(?::$port)?";
66  $segment = "$pchar*";
67  $path_abempty = "(?:/$segment)*";
68  $hier_part = "/{2}$authority$path_abempty";
69  $query = "(?:[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|"
70  $fragment = $query;
71   
72  $url =  "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?";
73  echo 'URL: ' . $url . "<br />\n";
74   
75  // no scheme, shortened authority, but host has to start with www.
76  $www_url =  "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?";
77  echo 'www.URL: ' . $www_url . "<br />\n";
78   
79  // no schema and no authority
80  $relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
81  echo 'relative URL: ' . $relative_url . "<br />\n";
82   
83  ?>