title: Website/URL Validation Regex in JAVA
body: <p>I need a regex string to match URL starting with "http://", "https://", "www.", "google.com"</p>
  
  <p>the code i tried using is:</p>
  
  <pre><code>//Pattern to check if this is a valid URL address
      Pattern p = Pattern.compile("(http://|https://)(www.)?([a-zA-Z0-9]+).[a-zA-Z0-9]*.[a-z]{3}.?([a-z]+)?");
      Matcher m;
      m=p.matcher(urlAddress);
  </code></pre>
  
  <p>but this code only can match url such as "<a href="http://www.google.com" rel="noreferrer">http://www.google.com</a>"</p>
  
  <p>I know this ma be a dupicate question but i have tried all of the regex provided and it does not suit my requirement. Willl someone please help me? Thank you.</p>