Answers for "c# regex match number"

1

c# regex match

const string input = "Lorem ipsum dolor sit %download%#456 amet, consectetur adipiscing %download%#3434 elit. Duis non nunc nec mauris feugiat porttitor. Sed tincidunt blandit dui a viverra%download%#298. Aenean dapibus nisl %download%#893434 id nibh auctor vel tempor velit blandit.";

static void Main(string[] args)
{
    Regex expression = new Regex(@"%download%#(?<Identifier>[0-9]*)");
    var results = expression.Matches(input);
    foreach (Match match in results)
    {
        Console.WriteLine(match.Groups["Identifier"].Value);
    }
}
Posted by: Guest on February-05-2021
1

regex for numbers

Regex regex = new Regex(@"^d$");
Posted by: Guest on November-14-2020
0

c# regex match

var regex = new Regex(@"(?<=%download%#)d+");
return regex.Matches(strInput);
Posted by: Guest on February-05-2021

Code answers related to "c# regex match number"

Browse Popular Code Answers by Language