Regular Expressions 101

Community Patterns

Your search did not match anything

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(([\w\.]+)(\.[^/\n]+)\/?(.*\/?)*)
/
gm

Description

Website finder

Author: Bryan Hu

What does this does

This can give you very useful information about the sites this regex extracts. It can extract the main domains of a variety of sites, give you useful information such as suffix, main domain name, and slash-extensions (i dunno what they are called). But remember: all of this in a single regex.

How can I use this

Use this all you want, no credit needed.

Examples of usage

  • Finding links and getting information
  • Extracting all the links on a page
  • To be copied (Yeah, cuz why not?)

Can I leave now?

There's nothing more to read. You can go!

Submitted by Bryan Hu - 5 years ago