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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:25:03+00:00 2026-05-25T00:25:03+00:00

For example, let’s say I wanted to match an uppercase letter A-Z , but

  • 0

For example, let’s say I wanted to match an uppercase letter A-Z, but not F-H. Uppercase letters would be [A-Z], and not F-H would be [^F-H] if I am not mistaken. Intuitively, I want it to be [A-Z^F-H], but that does not seem to be working. I know it could be done [A-EI-Z], but I am looking for less of a workaround solution. EDIT: looking for a more general solution.

  • 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-25T00:25:04+00:00Added an answer on May 25, 2026 at 12:25 am

    There is nothing that is “less of a workaround”. The character range syntax like [abcdef] is just for matching any of the enumerated characters. It can be inverted like [^abcdef]. Then [a-f] is provided as a syntactic shorthand for explicitly writing out all the characters. If you want to match multiple ranges with gaps between them, you have to specify the multiple ranges.

    If flex supports postivie/negative lookahead/lookbehind you could try messing with those features. I would be willing to bet it would come out way more complex to read and significantly less efficient than just writing [A-EI-Z].

    Edit: After reading your comment that the ‘holes’ you want in your range may not be known until runtime, you’d have to do it with lookahead/lookbehind. Syntax for that varies between regex engines, and I’m not sure about flex, or whether it can even do that. Essentially you’ll want a regex that matches [A-Z], with a negative lookbehind assertion for [F-H]. Or matches a positive lookahead assertion for [^F-H] followed by [A-Z].

    The key thing about lookahead/lookbehind is that they don’t actually consume any of the input, they just cause matching to fail if the assertion isn’t met at the current match position. They usually wind up less efficient than doing things directly (if you can), and can be tricky to get right, and different regex engines seem to have different restrictions about when you can and can’t use them.

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

Sidebar

Related Questions

Let's say for example I wanted to echo You are using Windows! or You
For example let say I have, create table product ( ID INT IDENTITY(1,1) NOT
For example let us say that we want to save a list of URLs
For Example: Let's say that I want to return a view that displays a
Let's say I want my program to do something after some inactivity. For example
Maybe a silly question but here goes anyway. Example: Let's say I have one
A simple example: Let's say I have one alias being sourced somewhere as: alias
There is an example (let us say in a file named mybatch.bat ): @echo
Is there any way to get PDF document text language? Example: Let's say I
Really simple example: Let's say I have this table: ID Name GUID1 John GUID2

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.