Menu

gitpiper

isAbsoluteURL javascript Code Snippet in 2025

stringbrowserregexpintermediate

Last Updated: 19 January 2025

Checks if the given string is an absolute URL.

  • Use RegExp.prototype.test() to test if the string is an absolute URL.
const isAbsoluteURL = str => /^[a-z][a-z0-9+.-]*:/.test(str);
isAbsoluteURL('https://google.com'); // true isAbsoluteURL('ftp://www.myserver.net'); // true isAbsoluteURL('/foo/bar'); // false

javascript snippet similar to isAbsoluteURL For You in January 2025

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2025 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️