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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:29:47+00:00 2026-06-07T12:29:47+00:00

I am writing a program using Qt 4.6 and I need to capture all

  • 0

I am writing a program using Qt 4.6 and I need to capture all occurences of non-range literals from expressions like
"SUM(A1:A3)+B1-B3+SUM(D1:D3)/COUNT(D1:D3)",
i.e. B1, B3, but not A1, A3, D1, D3. I have tried to use QRegExp, but it doesn’t support negative lookbehind assertions, so I can’t exclude literals like A3, D3.
My regexp (?<!:)([A-Z]{1,4}[1-9]\\d{0,3})(?!:) doesn’t work.
I need your input. Thanks.

  • 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-07T12:29:49+00:00Added an answer on June 7, 2026 at 12:29 pm

    In your case you could use

    (?:^|[^:])\b([A-Z]{1,4}[1-9]\d{0,3})\b(?!:)

    The first group matches the empty string at the beginning or any character except the colon. I also added word boundaries \b so that the pattern won’t match things like A4a.

    Often times it is simpler to write “positive” patterns. For example, using

    (...)(:...)?

    with ... denoting your [A-Z] pattern to match cell references, you can match ranges and non-ranges in one pass, then discard all ranges when looping over the results. You can easily detect whether a match is a range by checking if the second capture group is empty.

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

Sidebar

Related Questions

I am writing an application program using swing. I need to exit from the
Writing a program in which I need to split strings from a struct linked
I am currently writing a non-web program using mostly python and have gotten to
I'm writing a program using jdbc that will be an interface to database(smth like
I'm writing a program (for Mac OS X, using Objective-C) and I need to
I'm writing a program that randomly assembles mathematical expressions using the values stored in
I'm writing a program using c++ and opencv lib in which I need to
I am writing a program in C++ using Visual studio, what I need to
I am currently writing a program using Weka that builds a model (using one
I am writing a program using RedGate SQL Compare that syncs data between nodes

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.