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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:23:05+00:00 2026-05-31T10:23:05+00:00

I have checked several other questions on SO like this , this , this

  • 0

I have checked several other questions on SO like this, this, this, this, and this, but I can’t seem to figure out my issue from any of these. It is quite likely that I’m missing something simple, but I don’t know what.

I have a string like the following:
This is some random text{colA}that needs{COLBB} to be matched.

I need to match on the A and the BB but nothing else. The rules are as follows

  • The prefix will only be {col (case insensitive)
  • The suffix will only be }
  • The characters to match will only be letters
  • The match must be case insensitive
  • The match will only be 1 or 2 characters
  • A word break can’t be assumed before or after the prefix/suffix

I managed to get this: (?i:[a-z]{1,2}(?<={col[a-z]{1,2})(?=})) which matches {colaa} but not {cola} (In the case of {cola} it returns la when it needs to return a). I can’t figure out how to tune this to work with the two different match cases.

I’m working in .Net and would really appreciate any help I could get on this matter. I feel so close, yet so far away!

  • 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-31T10:23:06+00:00Added an answer on May 31, 2026 at 10:23 am

    The key is to move the lookbehind assertion to the beginning of the pattern, so we can specify the exact prefix, rather than having to assert on the prefix plus the matched part. So:

    (?i:(?<=\{col)[a-z]{1,2}(?=\}))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have checked several other threads but I am still having a problem. I
I've seen several questions similar to mine, but I can't seem to find a
I have checked out files from my svn repository to a local project folder.
I realize this is not terribly different from a lot of other questions that
I have several blocks that look like this: <div class='templatechoicedesigncss'> <img src='/images/templatepics/random(100x140).png' /> <p>
I have checked with the wikipedia article , and it seems like it is
I have checked in a huge Eclipse project from my desktop computer to the
I have checked the whole site and googled on the net but was unable
I have checked out now a local working copy of a codebase that lives
I have checked the regional settings in my emulator and I can't yet choose

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.