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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:06:28+00:00 2026-05-11T19:06:28+00:00

how can I convert this string: bKk_035A_paint-House_V003 to BKK_035a_paint-House_v003 with a regular expression (e.g.

  • 0

how can I convert this string:

bKk_035A_paint-House_V003
to
BKK_035a_paint-House_v003

with a regular expression (e.g. Regex.Replace)?
This regex matches the string:

^(?<Group1>[a-z][a-z0-9]{1,2})_(?<Group2>\d{3}[a-z]{0,2})_(?<Group3>[a-z-]+)_(?<Group4>v\d{3,5})$
  • Group1 = uppercase
  • Group2 = lowercase
  • Group3 = unchanged
  • Group4 = lowercase

Thanks for any help,
Patrick

  • 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-11T19:06:28+00:00Added an answer on May 11, 2026 at 7:06 pm

    the Regex doesn’t match the first string…

    I assume you want the first 3 chars upper case, and the rest lowercase?

    here’s a first pass:

    const string mod = @"^([a-z][a-z0-9]{1,2})(_\d{3}[a-z]{0,2}_[a-z]+_v{1}\d{3,5})$";
    var converted = 
        new Regex(mod, RegexOptions.IgnoreCase)
            .Replace(input1, 
                m => string.Format(
                       "{0}_{1}",
                       m.Groups[1].ToString().ToUpper(),
                       m.Groups[2].ToString().ToLower()
                     )
                    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I convert this type of Arraylist to Two Dimensional Arraylist ? ArrayList<ArrayList<String>>
Is this the best way to convert String hex to bytes? Or can you
How can I convert this string to have a space every 8th digit using
How can I convert this string, 12:00 AM , into a DateTime?
Can someone tell me how to convert this string 2012-01-01T08:44:36+01:00 to 2012-01-01 08:44:36 in
How can I convert this string into a byte? string a = 0x2B; I
How can I convert this string: This string contains the Unicode character Pi(π) into
How can I convert this string into XML? string sTemp = <message> <Category> <Category
I have 0,4*A1 in a cell (as a string). How can convert this string
How can I convert this string 05/Feb/2010:14:00:01 to unixtime ?

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.