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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:36:54+00:00 2026-05-31T02:36:54+00:00

I have the following rows in my table COL1 EXTRA DOUBLE TEST 12 TEST

  • 0

I have the following rows in my table

COL1                       EXTRA         DOUBLE       TEST
12 TEST
123 EXTRA
125 EXTRA 95 DOUBLE
EXTRA 45 99 DOUBLE 

I am using regular expressions to filter out the rows and move them appropriately to different columns. So:

  • For the first row, I want 12 to be extracted and put in column TEST.
  • For the second row, I want 123 to be extracted and put in column EXTRA.
  • For 3rd row, I want 125 to be extracted and put in column EXTRA.
  • I want to ignore 95.
  • For the last row, I want 45 to be extracted and put in column EXTRA.

I can extract the values and put them in appropriate columns through my query, I am using this regular expression for extracting the values:

'%[0-9]%[^A-Z]%[0-9]%'

the problem with this regular expression is that it extracts 12, but it does not extract 123 from the second row, if I change the regular expression to:

'%[0-9]*%[^A-Z]%[0-9]%' 

then it extracts 123, but for the third row, it concatenates 125 with 95 so I get 12595. Is there any way I can avoid 95 and just get the value 125? If I remove the star then it does not do any concatenation.

Any help will be appreciated. I posted this question before, but some of you were asking for more explanation so I posted a new question for that.

  • 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-31T02:36:55+00:00Added an answer on May 31, 2026 at 2:36 am

    I believe that the regex that you are looking for is below. This will match digits followed by numbers, followed by ignoring any future number patterns. However, I believe that when you use the %regex%regex%…, that it runs each regex separately, so I am not sure about the nuances of regex in SQL. However, if you run this against rubular.com it seems to solve the problem you are asking. Hopefully it can be of some use in your regex search 🙂

    ([0-9]*)([^A-Z])(?>[0-9]*)
    

    However, I did just look at your other examples of the letters coming first, and that would not work here. But, maybe this can still be of use to you

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

Sidebar

Related Questions

I have a the following table with rows: =============================================== id| name | group1 |
I have the following DataTable dt = new DataTable(); dt.Columns.Add(col1, typeof(string)); dt.Columns.Add(col2, typeof(string)); dt.Rows.Add(1,
I have almost 25000 rows in table questions and i have the following query
I have the following jQuery code for finding the sum of all table rows,
I have a column in a SQL Server table that has the following rows:
I have the following logic: public void InQueueTable(DataTable Table) { int incomingRows = Table.Rows.Count;
I have the following table Id col1 col2 col3 1 c 2 m 2
i have in a procedure which fills a table the following sql SELECT NVL(SUM(COL1),
I have the following html. Its a table that can contains many rows id=rows_x.
I have the following 3 rows in my database table ID resID userID source

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.