skip to Main Content

Php versions – Check URL/IP with port with regex

My Java 11/Android app has to check if the URL/IP the user entered could theoretically be valid (using myURL.trim().matches(regex)). What should be valid (including variations): stackoverflow.com http://stackoverflow.com http://amazon.co.uk https://www.amazon.co.uk ftp://10.1.1.9 10.1.1.9:1234 http://10.1.1.9:1234/bla What shouldn't be valid: http://bla bla "---" (without…

VIEW QUESTION

Javascript – Does the URL.toString() Functon encode the URL

I have the following example code: const url = new URL("http://example.com"); url.searchParams.append("name", "Mustermann"); url.searchParams.append("question", "how does the URL.toString() function work?"); window.open(url.toString(), '_self'); My question is does the URL encode the different searchParams? If it encodes the URL what function does…

VIEW QUESTION
Back To Top
Search