'How to check if valid facebook url, before submit

I am looking for a way to check, if the url a user have posted in my form is a valid facebook url. I am aware of the regx (?:(?:http|https):\/\/)?(?:www.)?facebook.com\/(?:(?:\w)*#!\/)?(?:pages\/)?(?:[?\w\-]*\/)?(?:profile.php\?id=(?=\d.*))?([\w\-]*)? But how to use it, am i not sure on how to do?

<div class="col-sm-6">
    <div class="col-sm-12">
        <b>Facebook Url</b>
        <input id="FacebookUrl" name="FacebookUrl" type="text" class="form-control" />
    </div>

    <div class="col-sm-12">
        <button id="SendBtn" class="btn btn-success pull-right">Send</button>
    </div>
</div>

How can i make a form validation on that, that checks the facebook regx? Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source