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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:20:19+00:00 2026-06-06T06:20:19+00:00

I have a script that executes database queries, and I use semi-colons + new

  • 0

I have a script that executes database queries, and I use semi-colons + new line (\n) to separate one query from another. See below:

CREATE TABLE `moxedo`.`mox_config` (`;`, `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT , `group_id` INT(3) UNSIGNED NOT NULL , `is_enabled` INT(1) UNSIGNED NOT NULL , `tag` VARCHAR(255) NOT NULL , `name` VARCHAR(80) NOT NULL , `value` VARCHAR(255) NOT NULL , `description` TEXT NOT NULL , `init_params` TEXT NOT NULL , `datetime_added` DATETIME NOT NULL , `datetime_lastmodified` DATETIME NOT NULL , `timestamp_univ` BIGINT(14) NOT NULL , PRIMARY KEY ( `id` ) )
ENGINE = INNODB; 
ALTER TABLE `moxedo`.`mox_config` ADD UNIQUE `ix_u_tag_ge` ( `tag` );

I’m looking for a Regex Pattern that will help me capture each database query. However, I need to also accommodate the occurrence of semi-colons within the query body, as the code above displays.

I’d appreciate some assistance. Thanks in advance.

  • 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-06T06:20:21+00:00Added an answer on June 6, 2026 at 6:20 am

    You can give this a try:

    (.*?;)(?!`)(?:\s|$)
    
    • (.*?;) – match everything followed by a semicolon…
    • (?!`) – … not followed by a single quote
    • (?:\s+|$) – followed by whitespace characters or the end of the string

    If there are other use cases where the semicolon can appear on a different position, the regex will need updated accordingly.

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

Sidebar

Related Questions

First, the set up: I have a script that executes several tasks after a
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have a script task that executes a dynamically created SQL restore statement. This
I have a bash script that does ssh to a remote machine and executes
I have some Perl code that executes a shell script for multiple parameters, to
I have a TSQL script that does a lot of database structure adjustments but
I have a PHP script that I wrote, and one of the pages connects
I have a script that runs a stored procedure in my SQL server database,
Here's the scenario: I have a Python script that is called from a browser
I have a PHP script that executes perfectly when called via the browser. It

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.