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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:32:49+00:00 2026-05-22T22:32:49+00:00

I have a regular expression that I use to grab data between two sets

  • 0

I have a regular expression that I use to grab data between two sets of id’s for example
<CLASSCOD>70</CLASSCOD> The regular expression I use is (?<=<CLASSCOD>)(?:[^<]|<(?!/CLASSCOD))* which works in most case but when i have a single value like this <CLASSCOD>N</CLASSCOD> it says there are no matches.

The whole data string looks like this

<DATE>0601</DATE>
<YEAR>11</YEAR>
<AGENCY>Department of the Interior</AGENCY>
<OFFICE>Bureau of Indian Affairs</OFFICE>
<LOCATION>BIA - DAPM</LOCATION>
<ZIP>85004</ZIP>
<CLASSCOD>N</CLASSCOD>
<OFFADD>Contracting Office - Western Region 2600 N. Central Avenue, 4th Floor Phoenix AZ 85004</OFFADD>
<SUBJECT>Boiler Replacement</SUBJECT>
<SOLNBR>A11PS00463</SOLNBR>
<RESPDATE>061711</RESPDATE>
<ARCHDATE>05312012</ARCHDATE>
<CONTACT>Geraldine M. Williams Purchasing Agent 6023794087 geraldine.williams@bia.gov;<a href="mailto:EC_helpdesk@NBC.GOV">Point of Contact above, or if none listed, contact the IDEAS EC HELP DESK for assistance</a>
</CONTACT>
<LINK><URL>https://www.fbo.gov/spg/DOI/BIA/RestonVA/A11PS00463/listing.html<LINKDESC>Link To Document</LINK>
<EMAIL></EMAIL>
<EMAIL>
  EC_helpdesk@NBC.GOV
  <EMAILDESC>
    Point of Contact above, or if none listed, contact the IDEAS EC HELP DESK for assistance
  </EMAILDESC>
</EMAIL>
<SETASIDE>Total Small Business</SETASIDE>
<POPCOUNTRY>USA</POPCOUNTRY>
<POPZIP>85634</POPZIP>
<POPADDRESS>BIE Tohono O'odham High School, Sells, AZ</POPADDRESS>

Any Suggestions as to the reason?

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-05-22T22:32:49+00:00Added an answer on May 22, 2026 at 10:32 pm

    Something simpler should work:

    <CLASSCOD>(.+?)</CLASSCOD>
    

    Example:

    Match match = Regex.Match(input, @"<CLASSCOD>(.+?)</CLASSCOD>");
    if (match.Success) {
        string value = match.Groups[1].Value;
        Console.WriteLine(value);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for a regular expression that will match any number from 1
I have a string with xml data that I pulled from a web service.
I have a web application that registered users use. These users have good email
I have idsfile.csv which is a comma separated file of ids (with no new
I have a directory which contains subdirectories which contain files. All the file names
I have a bunch of code that I need to do a search and
what Regex Expression do we need to use in this scenario Iam looking to
I'm trying to use regular expressions to remove certain blocks of coding from a
Can anyone explain regular expression text substitutions when the regular expression is held in
i have some strings with this pattern in some files: domain.com/page-10 domain.com/page-15 .... and

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.