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

  • Home
  • SEARCH
  • 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 96621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:50:51+00:00 2026-05-10T23:50:51+00:00

Medicare Eligibility EDI Example Responses is what I’m trying to match. I have a

  • 0

Medicare Eligibility EDI Example Responses is what I’m trying to match.

I have a string that looks like this:

LN:SMITHbbbbbbbbFN:SAMANTHAbbBD:19400515PD:1BN:123456PN:9876543210GP:ABCDEFGHIJKLMNOID:123456789012345bbbbbPC:123PH:8005551212CD:123456PB:123ED:20060101TD:2070101LC:NFI:12345678FE:20070101FT:20080101

I need a set of matches that look like this:

 Key | Value ------------------- LN  | SMITHbbbbbbbb FN  | SAMANTHAbb BD  | 19400515 ... etc 

I’ve been dealing with this all day, and I can’t seem to get an acceptable matching scenario. I’m about to program it procedurally with a for loop and finding indexes of colons if I can’t figure something out.

I’ve tried using negative lookahead and I’m not getting anywhere. This is C#, and I’m using this tester (.Net) while I’m testing, along with The Regex Coach (non .Net).

I’ve tried using this:

([\w]{2})\:(?![\w]{2}\:) 

But that only matches the keys and their colons, like ‘LN:’, ‘FN:’, etc.

If I use:

([\w]{2})\:(.+?)([\w]{2})\: 

It consumes the next matching two character key and colon as well, leading to me only matching every other key/value pair.

Is there a way for me to match these using RegEx in .Net correctly, or am I stuck with a more procedural solution? Keep in mind, I can’t assume that the keys will always be upper case letters. They could possibly include numbers, but they will always be two characters and then a colon.

Thanks in advance for any help I can get.

  • 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. 2026-05-10T23:50:52+00:00Added an answer on May 10, 2026 at 11:50 pm

    I think what you want is positive lookahead, not negative, so that you find the key-colon combo ahead of the current position, but you don’t consume it. This appears to work for your test example:

    ([\w]{2})\:(.+?)(?=[\w]{2}\:|$) 

    Yielding:

     LN: SMITHbbbbbbbb FN: SAMANTHAbb BD: 19400515 PD: 1 BN: 123456 PN: 9876543210 ... 

    Note: I added the colons in my test output, they aren’t captured by the regex.

    EDIT: Thanks, Douglas, I’ve edited the regex to capture end-of-string so the last entry is captured, too.

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

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You'll need a return type of Nullable(Of Integer). May 11, 2026 at 3:36 pm
  • added an answer You don't need to bind to a property, just bind… May 11, 2026 at 3:36 pm
  • added an answer I think Nick has the right idea. It sounds like… May 11, 2026 at 3:36 pm

Related Questions

Medicare Eligibility EDI Example Responses is what I'm trying to match. I have a
I've just started playing with Django and am loosely following the tutorial with my
I am trying to take a person and display their current insurance along with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.