News for hackers. Stuff that matters.
Re:In search of the perfect URL validation regex (2010) by toomanybeersies on Sunday September 26, 2021 @06:05AM (#28659668)
If you're writing browser JS, just use the URL builtin

  const isValidUrl = urlString => {
    try {
      new URL(urlString);
      return true;
    } catch {
      return false;
    }
  };

There are no comments on this comment yet.