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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:05:26+00:00 2026-05-12T22:05:26+00:00

Are there any regex experts who can help me clean up the following source

  • 0

Are there any regex experts who can help me clean up the following source code? I’m going through some existing code and I see several instances similar to the following:

public enum Numbers
{
    /// <summary>
    /// One = 1, 
    /// </summary>
    One = 1,

    /// <summary>
    /// Two = 2, 
    /// </summary>
    Two = 2,

    /// <summary>
    /// Three = 3, 
    /// </summary>
    Three = 3,

    /// <summary>
    /// Four = 4 but don't use this because it will break everything, 
    /// </summary>
    Four = 4,
}

Unless someone can tell me that the comments for 1-3 are necessary, I’d like to do a find/replace (remove) on all of the comments that don’t add any value to the code. From browsing the code I think it’s safe to assume that any line that resembles “/// word = number,” can be replaced. Cleaned up, I think it should look like:

public enum Numbers
{
    One = 1,
    Two = 2,
    Three = 3,

    /// <summary>
    /// Four = 4 but don't use this because it will break everything, 
    /// </summary>
    Four = 4,
}

Your help is greatly appreciated! And by helping me, you are really helping yourself. Because who knows, someday you might be maintaining this very code!

  • 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-12T22:05:26+00:00Added an answer on May 12, 2026 at 10:05 pm

    With VS2008 FindAndReplace I tried this and worked;

    Find what:

    /// \<summary\>.*\n.*\=:b:d[:b,]*\n.*\<\/summary\>\n
    

    Replace with:

    (empty)
    

    Use:

    Regular expressions

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

Sidebar

Related Questions

Is there any way to write a Regex that can validate one type of
gcc 4.6.2 c89 Is there any standard regex expression that can be used to
Is there any regex I can use to match blocks of exactly 10 digits?
Is there any open source solution, or a generic regex for parsing name-value (key-value)
Is there any way to handle the exception if regex.Matches didn't match anything and
Is there any way to have this: [one[two]][three] And extract this with a regex?
Is there any way I can use RegExp or Wildcard searches to quickly delete
Is there any way I can set a formatter on models that will convert
Is there any way of matching a regex from right to left? What Im
Is there any way to find which input character fails the regex pattern .

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.