Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // (19|20|21)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])\s([0-1][0-9]|2[0-3])[:]([0-5][0-9])[:]([0-5][0-9])
- // using System.Text.RegularExpressions;
- /// <summary>
- /// Regular expression built for C# on: Wed, Oct 7, 2015, 04:51:18 PM
- /// Using Expresso Version: 3.0.4750, http://www.ultrapico.com
- ///
- /// A description of the regular expression:
- ///
- /// [1]: A numbered capture group. [19|20|21]
- /// Select from 3 alternatives
- /// 19
- /// 19
- /// 20
- /// 20
- /// 21
- /// 21
- /// \d\d
- /// Any digit
- /// Any digit
- /// Any character in this class: [-]
- /// [2]: A numbered capture group. [0[1-9]|1[012]]
- /// Select from 2 alternatives
- /// 0[1-9]
- /// 0
- /// Any character in this class: [1-9]
- /// 1[012]
- /// 1
- /// Any character in this class: [012]
- /// Any character in this class: [-]
- /// [3]: A numbered capture group. [0[1-9]|[12][0-9]|3[01]]
- /// Select from 3 alternatives
- /// 0[1-9]
- /// 0
- /// Any character in this class: [1-9]
- /// [12][0-9]
- /// Any character in this class: [12]
- /// Any character in this class: [0-9]
- /// 3[01]
- /// 3
- /// Any character in this class: [01]
- /// Whitespace
- /// [4]: A numbered capture group. [[0-1][0-9]|2[0-3]]
- /// Select from 2 alternatives
- /// [0-1][0-9]
- /// Any character in this class: [0-1]
- /// Any character in this class: [0-9]
- /// 2[0-3]
- /// 2
- /// Any character in this class: [0-3]
- /// Any character in this class: [:]
- /// [5]: A numbered capture group. [[0-5][0-9]]
- /// [0-5][0-9]
- /// Any character in this class: [0-5]
- /// Any character in this class: [0-9]
- /// Any character in this class: [:]
- /// [6]: A numbered capture group. [[0-5][0-9]]
- /// [0-5][0-9]
- /// Any character in this class: [0-5]
- /// Any character in this class: [0-9]
- ///
- ///
- /// </summary>
- public static Regex regex = new Regex(
- "(19|20|21)\\d\\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01]"+
- ")\\s([0-1][0-9]|2[0-3])[:]([0-5][0-9])[:]([0-5][0-9])",
- RegexOptions.Multiline
- | RegexOptions.Compiled
- );
- // This is the replacement string
- public static string regexReplace =
- "NewItem.$1 = this.$1;";
- //// Replace the matched text in the InputText using the replacement pattern
- // string result = regex.Replace(InputText,regexReplace);
- //// Split the InputText wherever the regex matches
- // string[] results = regex.Split(InputText);
- //// Capture the first Match, if any, in the InputText
- // Match m = regex.Match(InputText);
- //// Capture all Matches in the InputText
- // MatchCollection ms = regex.Matches(InputText);
- //// Test to see if there is a match in the InputText
- // bool IsMatch = regex.IsMatch(InputText);
- //// Get the names of all the named and numbered capture groups
- // string[] GroupNames = regex.GetGroupNames();
- //// Get the numbers of all the named and numbered capture groups
- // int[] GroupNumbers = regex.GetGroupNumbers();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement