title: Need to write regex for top-level web address which includes letters, numbers, underscores as well as periods, dashes, and a plus sign
body: <p>The <code>check_web_address</code> function checks if the text passed qualifies as a top-level web address, meaning that it contains alphanumeric characters (which includes letters, numbers, and underscores), as well as periods, dashes, and a plus sign, followed by a period and a character-only top-level domain such as &quot;.com&quot;, &quot;.info&quot;, &quot;.edu&quot;, etc. Fill in the regular expression to do that, using escape characters, wildcards, repetition qualifiers, beginning and end-of-line characters, and character classes.</p>
  <pre><code>import re
  
  def check_web_address(text):
    pattern = ___
    result = re.search(pattern, text)
    return result != None
  
  print(check_web_address(&quot;gmail.com&quot;)) # True
  print(check_web_address(&quot;www@google&quot;)) # False
  print(check_web_address(&quot;www.Coursera.org&quot;)) # True
  print(check_web_address(&quot;web-address.com/homepage&quot;)) # False
  print(check_web_address(&quot;My_Favorite-Blog.US&quot;)) # True
  </code></pre>
  <p>I have tried with this pattern but all sample input came true:</p>
  <pre><code>pattern = '[^/@][A-Za-z._-]*$'
  </code></pre>
  <p>What will be exact pattern to cover all above scenario?</p>