UrlMatcher constructor

const UrlMatcher(
  1. [String pattern = r'(?:https?:)?(?://)?(?:' r'(?:[\w\-]{1,256}\.){1,5}[a-zA-Z]{2,10}' r'|\d{1,3}(?:\.\d{1,3}){3}' r'|localhost' r')(?::\d{1,5})?' r"(?:[/?#](?:(?:[\w\-.~%!#$&'()*+,/:;=?@\[\]]+/?)*[^\s.])?)?"]
)

Creates a UrlMatcher for parsing URLs.

The preset pattern is overwritten if a custom pattern is provided.

Implementation

const UrlMatcher([
  super.pattern = r'(?:https?:)?(?://)?(?:'
      r'(?:[\w\-]{1,256}\.){1,5}[a-zA-Z]{2,10}'
      r'|\d{1,3}(?:\.\d{1,3}){3}'
      r'|localhost'
      r')(?::\d{1,5})?'
      r"(?:[/?#](?:(?:[\w\-.~%!#$&'()*+,/:;=?@\[\]]+/?)*[^\s.])?)?",
]);