Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8305505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:07:50+00:00 2026-06-08T18:07:50+00:00

I know this question has been asked many times on SO, but I can’t

  • 0

I know this question has been asked many times on SO, but I can’t seem to get this to work.

I’m trying to use regular expressions to find matches for any Facebook URL, but not when the URL contains “plugins/like” (as in “http://www.facebook.com/plugins/like”)

I’ve come out with the following, and I’m not quite sure why it is not working:

https?://(www)?\.facebook\.[a-zA-Z]{2,4}/((?!plugins/like).)

Am I making a very obvious mistake? Sorry if it doesn’t make sense at all, but I’ve only trying a hand at PHP for the past five months.

Thank you very much for your time and your help.

Edit:
I’m getting matches for any FB URL so far, but it isn’t excluding anything that contains plugins/like

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:07:51+00:00Added an answer on June 8, 2026 at 6:07 pm
    $urls = array(
        'http://www.facebook.com/',
        'https://facebook.com/plugins/foo',
        'http://facebook.ru/plugins/like',
    );
    
    $pattern = '#^https?://(www\.)?facebook\.[a-z]{2,4}/(?!plugins/like)#';
    
    foreach ($urls as $url) {
        echo preg_match($pattern, $url) . PHP_EOL;
    }
    

    Okay?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked several times, but I can't quite seem
I know this question has been asked many times before but I can't find
I know this question has been asked before numorous times but they seem to
I know this question has been asked many times, but my problem is a
I know this is a question that has been asked many times before, but
I know this question has been asked and answered many times. But almost all
I know this question has been asked many times. But from what I read,
I know this question has been asked many times, but I have not been
I know this question has been asked for many times. I've searched but didn't
I know that this question has a been asked many times, but I still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.