• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Modify a Regular Expression

I have the following regular expression:

[\d]{1,2}:[\d]{2} - [\d]{1,2}:[\d]{2} \((?<1>[^\)]*)\)

and from my understanding it will accept:

##:## - ##:## (## [text])

If my interpretation is wrong, please correct me (I am trying to learn RegExpressions).  Anyway, I want to modify it so that it will accept:

date format: mm/dd/yy

date  ##:## - date  ##:##(## [text])

Any RegEx experts about?

Thanks
0
Ander5
Asked:
Ander5
1 Solution
 
planoczCommented:
Here is a sample for you to play with......

Imports System.Text.RegularExpressions


   Function MDYToDMY(ByVal input As String) As String
        Return Regex.Replace(input, "\b(?<month>\d{1,2})/(?<day>\d{1,2})/(?<year>\d{2,4})\b", _
            "${day}-${month}-${year}")
    End Function
0
 
Ander5Author Commented:
Alright, thanks :D
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now