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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:51:28+00:00 2026-06-10T10:51:28+00:00

I have a table for tags. Since some users have done copy-paste from our

  • 0

I have a table for tags. Since some users have done copy-paste from our website the some tags occur with count numbers at the end, like so:

Tag1
Tag1 (5)
Tag2
Tag1 (7)

As far as i know, mysql doesn’t support regex replace, so how can i remove these?

I don’t want to do it with php cause the table is large, and i’d like to run it regulary.

Expected end result:

Tag1
Tag1
Tag2
Tag1

Cheers!

  • 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-10T10:51:29+00:00Added an answer on June 10, 2026 at 10:51 am

    You can achive this by using string functions:

    SELECT TRIM(SUBSTRING(tag, 1, (CHAR_LENGTH(tag) - LOCATE('(', REVERSE(tag))))) AS new_tag
    FROM table_name;
    

    SQLFIDDLE DEMO HERE

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

Sidebar

Related Questions

i have a database table of website links. i have another table of tags,
I have a model containing a ManyToMany field to a table Tags. Since this
I have a table : tags(tagname,entryid,stamp) and i want to make a section for
I have a table with a tags nested inside the td tags. Problem is,
I have a table with images and tags in it (called tbl_images ) image_file
For example, I have a table, and there is a column named 'Tags'. I
I have the following situation: An Conversations entity/table which has multiple Tags associated to
The scenario is quite straight forward: I have content in table A and tags
I'm making a tag cloud. I have a table called tags with a row
I have the following code inside <table> tags. item is the result of the

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.