Regular Expression

Regular Expression
  1. Website Regex
    1. regex: ^((https?|ftp|smtp):\/\/)?(www.)?([a-zA-Z0-9]{2,})+\.[a-zA-Z0-9]+(\.[a-zA-Z0-9]*)?(\/[a-zA-Z0-9#]+\/?)*$
    2. Supported format
      1. https://themadhurgupta.blogspot.com
      2. https://themadhurgupta.blogspot
      3. https://themadhurgupta.blogspot.com/#madhur
      4. aa.com
      5. themadhurgupta.blogspot
      6. themadhurgupta.blogspot.com
      7. https://www.themadhurgupta.blogspot.com
    3. Here:
      ^ Should start with
      ((https?|ftp|smtp)://)? may or may not contain any of these protocols
      (www.)? may or may not have www.
      [a-z0-9]+(.[a-z]+) url and domain and also subdomain if any upto 2 levels
      (/[a-zA-Z0-9#]+/?)*/? can contain path to files but not necessary. last may contain a /
      $ should end there
      1. If you want to try to go on https://regex101.com/r/WUp6VL/1
      2. For a review of Regex Visit 



    Comments