title: How to check LinkedIn web link using RegEx Patterns in Java?
body: <p>Can anyone help me please?
  I am working on validation linked in url in java. I create a regular expression(which I am not familiar with) to validate the link however I am struggling with it. </p>
  
  <p>The code is as follows: </p>
  
  <pre><code>public class TestRegEx {
  
      public static void main(final String[] args) {
  
          // List of valid URLs
          List&lt;String&gt; validValues = new ArrayList&lt;&gt;();
          validValues.add("https://www.linkedin.com/sometext");
          validValues
                  .add("https://uk.linkedin.com/in/wiliam-ferraciolli-a9a29795");
          validValues.add("https://it.linkedin.com/hp/");
          validValues.add("https://cy.linkedin.com/hp/");
          validValues
                  .add("https://www.linkedin.com/profile/view?id=AAIAABQnNlYBIx8EtS5T1RTUbxHQt5Ww&amp;trk=nav_responsive_tab_profile");
  
  
          // List on invalid URLs
          List&lt;String&gt; invalidValues = new ArrayList&lt;&gt;();
          invalidValues.add("http://www.linkedin.com/sometext");
          invalidValues.add("http://stackoverflow.com/questions/ask");
          invalidValues.add("google.com");
          invalidValues.add("http://uk.linkedin.com/in/someDodgeAddress");
          invalidValues.add("http://dodge.linkedin.com/in/someDodgeAddress");
  
          // Pattern
          String regex = "(https://)(.+)(www.)(.+)$";
          Pattern pattern = Pattern.compile(regex);
  
          for (String s : validValues) {
              Matcher matcher = pattern.matcher(s);
              System.out.println(s + " // " + matcher);
          }
  
      }
  }
  </code></pre>
  
  <p>Can anyone help me to create a regex to validate the following
    <strong>Prefix:</strong>                "https://"
    <strong>Optional prefix:</strong>       "uk." (it can be nothing or another country)
    <strong>Middle:</strong>                "linkedin.com/"
    <strong>Suffix:</strong>                "any characters with a max of 200 chars"</p>
  
  <p>Regards</p>