Vorlagenprogrammierung Diskussionen Lua Test Unterseiten
Modul Deutsch English

Testfälle der Funktionen im Modul URLutil bei Nutzung als Vorlage.

Version: 2022-04-05 Wikidata: 2022-04-05

Parameter Erwartet Generiert
decode
»+tp%3A%2F%2FeXample.com%2F+« » tp://eXample.com/ « » tp://eXample.com/ «
»+tp%3A%2F%5BeX_ample%7Ccom%5D+« » tp:/[eX_ample|com] « » tp:/[eX_ample|com] «
»+tp%3A%2F%5BeX_ample%7Ccom%5D+« WIKI »+tp:/[eX ample|com]+« »+tp:/[eX ample|com]+«
encode
» http://eXample.com/ « »+http%3A%2F%2FeXample.com%2F+« »http%3A%2F%2FeXample.com%2F«
» http://eXample.com/ « WIKI »_http://eXample.com/_« »http://eXample.com/«
»http://eXample.com/tx[42]?a|b « PATH »http%3A%2F%2FeXample.com%2Ftx%5B42%5D%3Fa%7Cb%20« »http%3A%2F%2FeXample.com%2Ftx%5B42%5D%3Fa%7Cb«
»http://eXample.com/tx[42]?a|b « QUERY »http%3A%2F%2FeXample.com%2Ftx%5B42%5D%3Fa%7Cb+« »http%3A%2F%2FeXample.com%2Ftx%5B42%5D%3Fa%7Cb«
»#hash#« wiki »%23hash%23« »%23hash%23«
»*asterisk*« Wiki »%2Aasterisk*« »%2Aasterisk*«
»:colon:« WIKI »%3Acolon:« »%3Acolon:«
»;semicolon;« WIKI »%3Bsemicolon;« »%3Bsemicolon;«
getAuthority
» http://eXample.com« example.com »example.com«
» https://example.net/ppppp « example.net »example.net«
» ftp://AÖßd.org:8080/ppppp« aößd.org:8080 »aößd.org:8080«
»//127.0.0.1« 127.0.0.1 »127.0.0.1«
»http://encyclopédie.eu/Diderot« encyclopédie.eu »encyclopédie.eu«
»http://xn--encyclopdie-ibb.eu/Diderot« xn--encyclopdie-ibb.eu »xn--encyclopdie-ibb.eu«
»http://Россия.Рф/« россия.рф »россия.рф«
»//noTLD« »«
» http://example.com:/badPort« »«
getFragment
»//example.net/path#freak« #freak » #freak«
»//example.net/path#« # » #«
»//example.net/path« »«
»//example.net/path#L.C3.A4nge« #L.C3.A4nge » #L.C3.A4nge«
»//example.net/path#L.C3.A4nge«
WIKI
#Länge » #Länge«
»//example.net/path#L%C3%A4nge« #L%C3%A4nge » #L%C3%A4nge«
»//example.net/path#L%C3%A4nge«
%
#Länge » #Länge«
»//example.net/path#L%C3%A4nge«
WIKI
#Länge » #Länge«
»//example.net/path#L%C3%A4nge_2%«
WIKI
#Länge 2% » #Länge 2%«
»//example.net/path#L%C3%A4nge_2%«
%
#Länge_2% » #Länge_2%«
»//example.net/a"b"c#fox«
%
#fox » #fox«
getHost
» //EXAMPLE.ORG:8080/ppppp« example.org »example.org«
» https://example.net« example.net »example.net«
»//127.0.0.1« 127.0.0.1 »127.0.0.1«
»abc« »«
getLocation
»//example.net/path#freak« //example.net/path »//example.net/path«
»//example.net/path#« //example.net/path »//example.net/path«
»//example.net/path« //example.net/path »//example.net/path«
»//example.net/a"b"c#fox« //example.net/a"b"c »//example.net/a"b"c«
getNormalized
» //example.net/path#freak « //example.net/path#freak »//example.net/path#freak«
» //example.net/path# « //example.net/path »//example.net/path«
» //example.net « //example.net/ »//example.net/«
»//Example.net/path%3Acolon#freak« //example.net/path:colon#freak »//example.net/path:colon#freak«
»//Example.net/path%23hash#freak« //example.net/path%23hash#freak »//example.net/path%23hash#freak«
»//Example.net/path%5dbracket#freak« //example.net/path%5Dbracket#freak »//example.net/path%5Dbracket#freak«
»//Example.net/path]bracket#freak« //example.net/path%5Dbracket#freak »//example.net/path%5Dbracket#freak«
»//Example.net/path%20space#freak« //example.net/path%20space#freak »//example.net/path%20space#freak«
»//Example.net/path:colon#freak« //example.net/path:colon#freak »//example.net/path:colon#freak«
»//Example.net/path[bracketed]thing#freak« //example.net/path:%5Bbracketed%5Dthing#freak »//example.net/path%5Bbracketed%5Dthing#freak«
»//Example.net/piped|thing#freak« //example.net/piped%7Cthing#freak »//example.net/piped%7Cthing#freak«
»//Example.net/path<bracketed>thing#freak« //example.net/path:%3Cbracketed%3Ething#freak »//example.net/path%3Cbracketed%3Ething#freak«
getPort
» //EXAMPLE.ORG:8080/ppppp« 8080 »8080«
» //example.org:0/ppppp« »«
» //example.org:/ppppp« »«
getQuery
» /path/sub?q=1#f « ?q=1 »?q=1«
»/path/sub?a=1&b=2&c=3#f«
a
1 »1«
»/path/sub?a=1&b=2&c=3#f«
b
2 »2«
»/path/sub?a=1&b=2&c=3#f«
b
3 »3«
»/path/sub?a=1;b=2;c=3#f«
b
;
2 »2«
»//example.net/a&#x22;b&#x22;c?a=1;b=2;c=3#f« ?a=1;b=2;c=3 »?a=1;b=2;c=3«
getRelativePath
»https://Example.COM« / »/«
»http://Example.COM/« / »/«
»https://Example.COM/PATH« /PATH »/PATH«
»//example.net/path/finder#target« /path/finder#target »/path/finder#target«
»/path#f« /path#f »/path#f«
» /path/sub?q=1#f « /path/sub?q=1#f »/path/sub?q=1#f«
»path#f« »«
getScheme
»//aaa« // »//«
»HTTP://aaa« http:// »http://«
» https://example.com« https:// »https://«
»http://« http:// »http://«
»//« // »//«
»http:« »«
» ://example.net« »«
» https//example.com« »«
getSortkey
» https://example.com« ///com.example 0 https: »///com.example 0 https: «
» https://de.wiki.org/w/index.php?red« ///org.wiki.de 0 https: w/index.php?red »///org.wiki.de 0 https: w/index.php?red«
getTLD
»https://Example.COM« com »com«
»//isnich.Nirgends.nix/index.php?« nix »nix«
»http://Россия.Рф/« рф »рф«
»//127.0.0.1« »«
»//nowhere/index.php?« »«
»example.org« »«
getTop2domain
»https://Example.COM« example.com »example.com«
»//isnich.Nirgends.nix/index.php?« nirgends.nix »nirgends.nix«
»//0xFF.nowhere/index.php?« 0xFF.nowhere »0xff.nowhere«
»//www.expo.02.ch/index.php?« 02.ch »02.ch«
»http://Россия.Рф/« россия.рф »россия.рф«
»//127.0.0.1« »«
»//nowhere/index.php?« »«
getTop3domain
»//isnich.Nirgends.nix/index.php?« isnich.nirgends.nix »isnich.nirgends.nix«
»https://Example.COM« »«
isAuthority
»sub.example.org:80« 1 »1«
»127.0.0.1« 1 »1«
»http://example.org« »«
isDomain
»sub.example.org« 1 »1«
»Россия.Рф« 1 »1«
»127.0.0.1« »«
»sub.example.org:80« »«
»https://example.net/ppppp« »«
isDomainExample
»sub.example.org« »«
»https://Example.COM« 1 »1«
»//isnich.Nirgends.nix/index.php?« »«
isDomainInt
»http://encyclopédie.eu/Diderot« 1 »1«
»http://xn--encyclopdie-ibb.eu/Diderot« 1 »1«
»http://Россия.Рф/« 1 »1«
»sub.example.org« »«
»https://Example.COM« »«
»//isnich.Nirgends.nix/index.php?« »«
isHost
»sub.example.org« 1 »1«
»127.0.0.1« 1 »1«
»sub.example.org:80« »«
»http://example.org« »«
isHostPathResource
»sub.example.org« 1 »1«
»127.0.0.1« 1 »1«
»sub.example.org:80« 1 »1«
»http://example.org« 1 »1«
»http://example.org/resourcePath« 1 »1«
»example.org/resourcePath« 1 »1«
»example.org resourcePath« »«
isIP
»127.0.0.1« 4 »4«
»84.177.167.75« 4 »4«
»2001:0db8:85a3:08d3:1319:8a2e:0370:7344« 6 »6«
»Benutzerlein« »«
» « »«
»987.654.321.0« »«
isIPlocal
»0.1.2.3« 1 »1«
»0.100.200.300« 1 »1«
»10.20.30.40« 1 »1«
»10.100.200.300« »«
»127.0.0.1« 1 »1«
»127.20.0.1« 1 »1«
»172.0.0.1« »«
»172.20.0.1« 1 »1«
»172.200.0.1« »«
isIPv4
»84.177.167.75« 1 »1«
»4.5.6.7« 1 »1«
»1.02.03.04« 1 »1«
»1.002.003.004« »«
»1.02.003.0004« »«
»004.005.006.007« »«
»0.0.0.0« »«
»2001:0db8:85a3:08d3:1319:8a2e:0370:7344« »«
»Benutzerlein« »«
isIPv6
»127.0.0.1« »«
»2001:0db8:85a3:08d3:1319:8a2e:0370:7344« 1 »1«
»Benutzerlein« »«
isMailAddress
» ö.gn-fn@example.net « 1 »1«
»example.net« »«
»user.gn-fn@« »«
»foo@bar« »«
isMailLink
» mailto:ö.gn-fn@example.net « 1 »1«
» ö.gn-fn@example.net « »«
isProtocolDialog
»irc« 1 »1«
»mailto:« 1 »1«
»http:« »«
isProtocolWiki
»//« 1 »1«
»http://« 1 »1«
»http:« 1 »1«
»https« 1 »1«
»HTTP« 1 »1«
»wais« »«
»irc« »«
»http//« »«
isResourceURL
» https://example.net/ppppp « 1 »1«
» gopher://example.net/ppppp « »«
»http://example.org#fragment« »«
isSuspiciousURL
»http://example.com/p[x]=5« 1 »1«
»http://example.org/a|b« 1 »1«
»//127.0.0.1:8080/Ppp« »«
isUnescapedURL
»http://example.com/p[x]=5« 1 »1«
»http://example.org/p=5« »«
isWebURL
»HTTP://Example.net:80/ppppp« 1 »1«
»//127.0.0.1:8080/Ppp« 1 »1«
»https://e.foundation/« 1 »1«
»http://example.org/ path« »«
»/example.org/path« »«
wikiEscapeURL
»http://example.com/p[x]=5« http://example.com/p&#91;x&#93;=5 »http://example.com/p&#91;x&#93;=5«