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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:46:49+00:00 2026-05-30T02:46:49+00:00

I hate to ask another how do you do this with regex question on

  • 0

I hate to ask another “how do you do this with regex” question on here…there seem to be a lot of them. But, I am struggling with this.

I am working in C#, and I need to correct a datetime string before I convert it from a string to a DateTime datatype variable. My string looks like this:

2012-01-24T17-52-08Z

I need to replace the “-” characters that occur after the “T” with colons, so it will look like this:

2012-01-24T17:52:08Z

I have tried to adapt the code from this example but, to no avail. I have been using this wonderful tool to try to get this working.

I know this will be simple to someone who regularly works with RegEx but, I work with it so rarely that I forget most of what I learned before I get a chance to use it again.

Thanks for any help you can give.

  • 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-30T02:46:51+00:00Added an answer on May 30, 2026 at 2:46 am

    Can you try matching with (\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})Z

    and replacing with $1:$2:$3Z

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

Sidebar

Related Questions

I hate to ask this question on this forum, but I'm having a lot
Okay I hate to ask this question ... but here goes. I am writing
I hate to have to ask, but I'm pretty stuck here. I need to
I hate to ask this here, but many people on stackoverflow have talked about
I hate to ask this question as I am aware that there are plenty
I hate that I have to ask a homework question on here, but I
I don't know if I can ask this question here. I usually mistake, but...
I'd hate to ask an intentionally subjective question on here, but I don't have
I hate ask stupid questions like this, but why doesn't my code do what
I hate to ask such a general question, but the following code is a

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.