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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:47:42+00:00 2026-05-24T11:47:42+00:00

I have a text field to accept regular expressions from the UI. For these

  • 0

I have a text field to accept regular expressions from the UI. For these regular expressions, I have a search capability and want to do a search. I am using prepared statements and the DB is mysql. When I do a search on ‘%’, I only want search regex starting with ‘%’. But, since ‘%’ is wildcard in mysql, I get all the regex in the search. How to escape 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-05-24T11:47:46+00:00Added an answer on May 24, 2026 at 11:47 am

    Just use a backslash before the character, as shown in the MySQL documentation section 9.1:

    \0  An ASCII NUL (0x00) character.  
    \'  A single quote ("'") character.  
    \"  A double quote (""") character.  
    \b  A backspace character.  
    \n  A newline (linefeed) character.  
    \r  A carriage return character.  
    \t  A tab character.  
    \Z  ASCII 26 (Control+Z). See note following the table.  
    \\  A backslash ("\") character.  
    \%  A "%" character. See note following the table.  
    \_  A "_" character. See note following the table.  
    

    Note (from the MySQL documentation):

    If you use “\%” or “\_” outside of pattern-matching contexts, they evaluate to the strings “\%” and “\_”, not to “%” and “_”.

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

Sidebar

Related Questions

I want to make the text field only accept numeric and backspace button from
I have a text input field like text box or text area. I want
I have to store hindi text in a MySQL database, fetch it using a
How to set up text field that only accept certain words? I have about
I have created a text field to enter an amount of money. I want
I have a text field (flash.display.textField) for editing, but the default font does not
I have a text field and am looking to have if be valid for
If I have a text field with SWT, how can I get the field
Hi I have a text field which I would like to bind to a
I am making a text based game in Java. I have a text field,

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.