URL Parsing with Regular Expressions

Hello, All! I'm very need pattern for checking url :)Thanks In Advance
[85 byte] By [X-Bita] at [2007-10-2 21:34:49]
# 1
No you're not!You just need to try constructing a java.net.URI with it. If you succeed, it's valid If it throws a URISyntaxException, it's not.
ejpa at 2007-7-14 0:48:43 > top of Java-index,Core,Core APIs...
# 2

Sometimes it's better to use own simple parser because these are correct URLs due to URI constructor:

http://1:2:3:4:5

http://@@@@@@@@@@@@@@

http://::::::::::::::::::::::

http://////

http::::

aa:://

!!!!!!!!!!!!!!

?

Everybody can check:

<pre>

import java.net.*;

class a

{

public static void main( String[] args ) throws java.net.URISyntaxException

{

URI u = new URI( args[ 0 ] );

return;

}

}

</pre>

Michael.Nazarov@sun.coma at 2007-7-14 0:48:43 > top of Java-index,Core,Core APIs...