Differences

This shows you the differences between two versions of the page.

links:php:regular-expression [2012/02/03 09:32]
Knut Heermann (flip-flop)
links:php:regular-expression [2018/06/03 18:08] (current)
Line 145: Line 145:
\\ \\
-Läst nur Jahre 1583 bis 9999 zu:+Lässt nur Jahre 1583 bis 9999 zu:
<code reg> <code reg>
^(?:(?:[2468][048]|16|[3579][26])(?:[02468][048]|[13579][26])|(?:[2468][1-35-79]|1[789]|[3579][013-57-9])(?:0[48]|[2468][048]|[13579][26])|15(?:88|9[26]))([-.\/]?)02\1 29|(?:[2-9]\d\d\d|1[6-9]\d\d|159\d|158[3-9])([-.\/]?)(?:(?:0[13578]|1[02])\2(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)\2(?:0[1-9]|[12]\d|30)|02\2(?:0[1-9]|1\d|2[0-8]))$ ^(?:(?:[2468][048]|16|[3579][26])(?:[02468][048]|[13579][26])|(?:[2468][1-35-79]|1[789]|[3579][013-57-9])(?:0[48]|[2468][048]|[13579][26])|15(?:88|9[26]))([-.\/]?)02\1 29|(?:[2-9]\d\d\d|1[6-9]\d\d|159\d|158[3-9])([-.\/]?)(?:(?:0[13578]|1[02])\2(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)\2(?:0[1-9]|[12]\d|30)|02\2(?:0[1-9]|1\d|2[0-8]))$
Line 188: Line 188:
\\ \\
-==== E-Mail prüpfen:  ====+==== E-Mail prüfen:  ====
Angelehnt an  [[http://www.infos24.de/phpe/handbuch/6_php_regular_expression.htm|Die Funktion preg_match_all]] [infos24 GmbH] Angelehnt an  [[http://www.infos24.de/phpe/handbuch/6_php_regular_expression.htm|Die Funktion preg_match_all]] [infos24 GmbH]
-<code reg|h E-Mail check |h>+<code reg>
$email    = test@example.com $email    = test@example.com
$email_ok = preg_match("!^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$!",$email); $email_ok = preg_match("!^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$!",$email);
links/php/regular-expression.1328257923.txt.gz · Last modified: 2018/06/03 18:06 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0