V
V
Vimake2014-01-03 00:54:25
C++ / C#
Vimake, 2014-01-03 00:54:25

Is there an alternative to preg_match php for c#?

Is there an alternative to preg_match php for c#, please help better with an example.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Danilov, 2014-01-03
@Vimake

Add using System.Text.RegularExpressions;, well, here's an example:

var match = Regex.Match("forexamp1e", @"(\d+)");
var result = match.Groups[1].ToString();
Console.WriteLine(result); // Выведет "1".

S
Sergey, 2014-01-03
Protko @Fesor

read the doc on MSDN

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question