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 8850139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:49:50+00:00 2026-06-14T12:49:50+00:00

My url validation regex is allowing more than 1 . when the www rule

  • 0

My url validation regex is allowing more than 1 . when the www rule next to it works fine.
Can u see why and how to solve it? And feel free to comment on my regex

function isurl($this_url)
{
        if(preg_match("/^((http|https):\/{2})+([w]{3})+([\.]{1})+([a-zA-Z0-9-]+)+([\.]{1})+((a[cdefgilmnoqrstuwxz]|aero|arpa)|(b[abdefghijmnorstvwyz]|biz)|(c[acdfghiklmnorsuvxyz]|cat|com|coop)|d[ejkmoz]|(e[ceghrstu]|edu)|f[ijkmor]|(g[abdefghilmnpqrstuwy]|gov)|h[kmnrtu]|(i[delmnoqrst]|info|int)|(j[emop]|jobs)|k[eghimnprwyz]|l[abcikrstuvy]|(m[acdghklmnopqrstuvwxyz]|mil|mobi|museum)|(n[acefgilopruz]|name|net)|(om|org)|(p[aefghklmnrstwy]|pro)|qa|r[eouw]|s[abcdeghijklmnortvyz]|(t[cdfghjklmnoprtvwz]|travel)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw])$/i", $this_url)) 
            {
            return true;
            }

}


$this_url = "http://www..domain.com";

if (isurl($this_url)) 
{echo "Success";} 
else 
{echo "Fail";}
  • 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-14T12:49:51+00:00Added an answer on June 14, 2026 at 12:49 pm

    remove the + in this ([\.]{1})+, + mean one or more. try this

    ([\.]{1})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: jQuery Youtube URL Validation with regex YouTube url id Regex http://www.youtube.com/watch?v=SCS7SIeF30E http://www.youtube.com/watch?v=SCS7SIeF30E&feature=relmfu
Duplicate: PHP validation/regex for URL My goal is create a PHP regex for website
I'm making a URL validation helper which I set as a rule in my
Possible Duplicate: PHP validation/regex for URL Hi, in my form I have a url
Possible Duplicates: Checking for a valid url using Javascript Regular Expressions PHP validation/regex for
Possible Duplicate: PHP validation/regex for URL Is there any easy, secure and fast way
My regex successfully validates many URLs except http://www.google Here's my URL validator in JSFiddle:
I have a URL validation method which works pretty well except that this url
In my scenario I'd like to display a text with URL link within validation
All, I am trying to use JQuery's URL Validator plugin. http://docs.jquery.com/Plugins/Validation/Methods/url I have a

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.