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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:05:21+00:00 2026-05-28T14:05:21+00:00

When it comes to Regex I am dumber than a door nail, so when

  • 0

When it comes to Regex I am dumber than a door nail, so when making a Firefox extension I asked a friend for help and he gave me this:

if( doc.location.href.match(/(www\.google.*?[?&]q=[^&]+)/i) )

but the AMO editor rejected it saying it was too broad (for instance it would match http://uptime.netcraft.com/up/graph?site=www.google.com), can someone help me / give me a regex that matches the following (according to the editor it should match basically this) : http(s)://www.google.tld/q=*

So for example it should match
http or https (normal and secure) as well as any tld after Google (like .ru, .se, .fr, .in etc)

In other words it should only match Google search.

Thanks in advance for your help!

/Ryan

  • 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-05-28T14:05:22+00:00Added an answer on May 28, 2026 at 2:05 pm

    Try

    /^https?:\/\/(?:www\.)?google(?:\.[a-z]{2,3}){1,2}\/.*[&\?]q=[^&]+?/i
    

    The (?:\.[a-z]{2,3}){1,2} is to match like .com.au, .co.uk etc.

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

Sidebar

Related Questions

This regex comes from Atwood and is used to filter out anchor tags with
I'm a complete novice when it comes to regex. Could someone help me convert
Trying to use a reasonably long regex and it comes down to this small
I need help with a REGEX that will find a link that comes in
How comes this writes False? Console.Write(Regex.IsMatch([abcde]{1,16}, babe)); What's wrong with my regex? Doesn't that
I am a complete newb when it comes to regex, and would like help
Using Regex in .Net I will have a set of data that comes in
Is it possible to use regex to turn this <site-ui:header title=error backURL=javascript:history.go(-1); /> into
still struggling with regex :) i have this code: $link = '/\bhttp:\/\/.+\..+[\/\w]?\b/i'; $match =
Can someone show me the error of my ways when it comes to this

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.