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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:13:17+00:00 2026-06-13T11:13:17+00:00

I have: A string with value www.facebook.com A column allowed_domain with value facebook.com I

  • 0

I have:

  • A string with value www.facebook.com
  • A column allowed_domain with value facebook.com

I try to see if the domain string (with subdomains) matches the column (without subdomain) as such:

SELECT * FROM MyTable
   WHERE 'www.facebook.com' REGEXP '^([a-zA-Z0-9]+\.)*' + allowed_domain + '$' 

The string “www.facebook.com” is extracted from the referrer in my actual code.

You can see the regexp I’m using in action here

My problem is that the regexp isn’t matching in MySql. What’s wrong with it?

  • 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-13T11:13:17+00:00Added an answer on June 13, 2026 at 11:13 am

    Found the solution here: Using Columns in a RegExp in MySQL. I needed to send a single string object into the regexp as such:

    REGEXP concat('^([a-zA-Z0-9]+\.)*', domain, '$')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: http://www.example.com/value/1234/different-value How can I extract the 1234 ?
I have the following method: protected BigDecimal stringToBigDecimal(String value) throws ParseException { if (Pattern.matches([\\d,.]+,
I have a string //webcache.googleusercontent.com/search?hl=en&lr=&rlz=1G1GGLQ_IWIL297&q=cache:UadRLVLrpCQJ:http://www.buy.com/prod/pny-geforce-9800-gx2-1gb-512-bit-ddr3-600mhz-pci-e-2-0-dual-dvi-hdmi/207534756.html%2BVCG98GX2XPB%2Bsite%253Abuy.com&ct=clnk How can I check if it contains a sequence
I have a string with the value: var string = <img alt='' src='http://api.com/images/UID' /><br/>Some
I have string value and Type of some variable (For example int and 32
I have a string value coming from a label in the .aspx page as
I have a string value from a user input box. I have to figure
i have a string: String value = (name) Says: hello (/name); where name could
I have a string value. NSString *myString = @Latitude:-31.9504140#Longitude:115.8606040; How can I retrieve the
I have a string: Range(T4).Value = Rule 13s voilation I want to write 13s

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.