2011-04-06 57 views

回答

1

你能做到這樣,沒有正則表達式:

public boolean validateURI(String uri) 
{ 
    try 
    { 
     new URI(uri); 
     return true; 
    } catch(Exception e) 
    { 
     return false; // MalformedURI Exception, is the name I think 
    } 
} 

URL extends URI,你可以說,我想......