Zum Inhalt springen

Modul:URLutil: Unterschied zwischen den Versionen

REfix
w>PerfektesChaos
(+ wikiEscapeURL)
w>PerfektesChaos
(REfix)
Zeile 1: Zeile 1:
--[=[ URLutil 2013-05-22
--[=[ URLutil 2013-06-14
Utilities for URL etc. on www.
Utilities for URL etc. on www.
* getAuthority()
* getAuthority()
Zeile 172: Zeile 172:
           end
           end
     if type( s ) == "string" then
     if type( s ) == "string" then
         local p1, p2, p3, p4 = s:match( "^%s*([12][0-9]?[0-9]?)%.([012][0-9]?[0-9]?)%.([012][0-9]?[0-9]?)%.([012][0-9]?[0-9]?)%s*$" )
         local p1, p2, p3, p4 = s:match( "^%s*([1-9][0-9]?[0-9]?)%.([12]?[0-9]?[0-9])%.([12]?[0-9]?[0-9])%.([12]?[0-9]?[0-9])%s*$" )
         if p1 and p2 and p3 and p4 then
         if p1 and p2 and p3 and p4 then
             return legal( p1 ) and legal( p2 ) and legal( p3 ) and legal( p4 )
             return legal( p1 ) and legal( p2 ) and legal( p3 ) and legal( p4 )
Anonymer Benutzer