JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"></div>

JavaScript

var str = "http://www.facebook.com/something";
alert(str.match(/https?\:\/\/(?:www\.)?facebook\.com\/(\d+|[A-Za-z0-9\.]+)\/?/));