Verify the URL in Java
•
Java
Who knows how to use regular expressions to verify the URL format in Java?
thank you
Solution
A very sneaky way is:
try { new java.net.URI(myUrl); } catch(URISyntaxException e) { // url badly formed }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码