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

  • Home
  • SEARCH
  • 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 8805159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:47:31+00:00 2026-06-14T01:47:31+00:00

I am trying to query a MYSQL database using regular expressions. I am looking

  • 0

I am trying to query a MYSQL database using regular expressions. I am looking to get the values under columns with this pattern 1234X32X12.

I have written some pseudo-code, but I am unfamiliar with regular expressions, so I was hoping someone could help me out.

CODE:

if ($transposed_array[$i][0] starts with number)
    {
        $sid = regex something /^[0-9]*/
        $gid = regex something /X[0-9]*X/
        $gid = remove first and last character from $gid
        $qid = regex something /[0-9]*$/

        $question_text = mysql_query("select question from table where sid = ".$sid." and gid = ".$gid." and qid = ".$qid." limit 1");
        $transposed_array[$i][0] = $question_test
    }

Any help would be appreciated!

  • 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-14T01:47:32+00:00Added an answer on June 14, 2026 at 1:47 am

    MySQL supports regex matching directly in its SQL commands, check out its manual:

    select col from table where col regexp '^h';
    

    (see this at sqlfiddle)

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

Sidebar

Related Questions

I'm trying to query a MySQL database using an array but I'm having trouble!
I am trying to query a MySQL database using webpy. From the SQL query,
I am trying to run a query off of my mysql database using the
I am trying to retrieve values from the database using mysql and PHP. The
I am trying to get the user details form mysql database by using the
I'm trying to create a simple database table using the PHP MySQL query Create
I'm trying to query my MySQL database to get information about a user. You
I'm trying to do a MySQL Query that adds information to a database in
I am trying to reconstruct a database query I created for MySQL in Microsoft
im trying to insert this query with mysql_query INSERT INTO um_group_rights (`um_group_id`,`cms_usecase_id`,`um_right_id`) VALUES (2,1,1)

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.