<commit_before>using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace SemVer
{
    // A version that might not have a minor or patch
    // number, for use in ranges like "^1.2" or "2.x"
    internal class PartialVersion
    {
        public int? Major { get; set; }

        public int? Minor { get; set; }

        public int? Patch { get; set; }

        public string PreRelease { get; set; }

        private static Regex regex = new Regex(@"^
                (\d+|[Xx\*])                     # major version
                (
                    \.
                    (\d+|[Xx\*])                 # minor version
                    (
                        \.
                        (\d+|[Xx\*])             # patch version
                        (\-([0-9A-Za-z\-\.]+))?  # pre-release version
                        (\+([0-9A-Za-z\-\.]+))?  # build version (ignored)
                    )?
                )?
                $",
            RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

        public PartialVersion(string input)
        {

            string[] xValues = { "X", "x", "*" };

            if (input.Trim() == "")
            {
                // Empty input means any version
                return;
            }

            var match = regex.Match(input);<commit_msg>Allow v or = in partial version string<commit_after>using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace SemVer
{
    // A version that might not have a minor or patch
    // number, for use in ranges like "^1.2" or "2.x"
    internal class PartialVersion
    {
        public int? Major { get; set; }

        public int? Minor { get; set; }

        public int? Patch { get; set; }

        public string PreRelease { get; set; }

        private static Regex regex = new Regex(@"^
                [v=\s]*
                (\d+|[Xx\*])                     # major version
                (
                    \.
                    (\d+|[Xx\*])                 # minor version
                    (
                        \.
                        (\d+|[Xx\*])             # patch version
                        (\-([0-9A-Za-z\-\.]+))?  # pre-release version
                        (\+([0-9A-Za-z\-\.]+))?  # build version (ignored)
                    )?
                )?
                $",
            RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

        public PartialVersion(string input)
        {

            string[] xValues = { "X", "x", "*" };

            if (input.Trim() == "")
            {
                // Empty input means any version
                return;
            }

            var match = regex.Match(input);
{'fraction_non_alphanumeric': 0.12714651077822434, 'fraction_numerical': 0.005115089514066497, 'mean_word_length': 1.077389984825493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3591356', 'n_tokens_mistral': 780, 'n_tokens_neox': 692, 'n_words': 190}