localhost url validation
See original GitHub issueI noticed that localhost is not valid according to URL validator.
examples url: http://localhost/ http://localhost/deeplink
this is the regex used for validation right now:
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i
the following change would fix it:
/https?:\/\/(((www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63})|(localhost))\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i
I’d appreciate your feedback about it.
in addition, I’d like to know when is expected next release?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
UrlValidator is not working for localhost - Stack Overflow
I'm facing an issue that i'm using UrlValidator in my code. UrlValidator urlValidator = UrlValidator.getInstance(); if(urlValidator.isValid(url)) ...
Read more >URL (with localhost) - Regex Tester/Debugger
Check if a string only contains numbers · Only letters and numbers · Match elements of a url · Url Validation Regex |...
Read more >Validate localhost url · Issue #224 · jquense/yup - GitHub
This would be incredibly useful, my application requires setting OAuth redirect URL's within a form that I'm validating. For development these ...
Read more >Host URL Pattern - RegExr
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
Read more >UrlValidator (Apache Commons Validator 1.7 API)
Allow local URLs, such as http://localhost/ or http://machine/ . static long, NO_FRAGMENTS. Enabling this options disallows any URL fragments. Constructor ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@syabro Hey there, my apologies. I thought this had already been fixed, but alas I missed it. I am working on a new build (version 3.23) which I will include this issue.
Thanks!