Please check this example:
const string str = "Name: music mix.mp3 Size: 2356KB";
var match = Regex.Match(str, "Name: (.*) Size:");
Console.WriteLine("Match: " + match.Groups[1].Value);
More Related Contents:
- RegEx to remove single quote, parentheses or square bracket from both beginning and end of a string [closed]
- How do I match an entire string with a regex?
- Find and extract a number from a string
- How do I extract text that lies between parentheses (round brackets)?
- How do I replace the *first instance* of a string in .NET?
- How do I access named capturing groups in a .NET Regex?
- What are regular expression Balancing Groups?
- Regular expression to remove HTML tags
- Regular Expression to split on spaces unless in quotes
- Why does the order of alternatives matter in regex?
- Regex to strip line comments from C#
- What’s the difference between “groups” and “captures” in .NET regular expressions?
- Remove text in-between delimiters in a string (using a regex?)
- Count regex replaces (C#)
- Using WebClient in C# is there a way to get the URL of a site after being redirected?
- Translate Perl regular expressions to .NET
- Regex replace multiple groups
- Are Java and C# regular expressions compatible?
- C# – Regex for file paths e.g. C:\test\test.exe
- RegEx – reusing subexpressions
- Regex: Repeated capturing groups
- Ignoring white space for a Regex match
- How to make a regex match case insensitive?
- Why doesn’t $ in .NET multiline regular expressions match CRLF?
- How to use inline modifiers in C# regex?
- C# System.RegEx matches LF when it should not
- Regex for matching a character, but not when it’s enclosed in square bracket
- Regular expression for 10 digit number without any special characters
- regex to split line (csv file)
- is there a elegant way to parse a word and add spaces before capital letters