Created
November 30, 2016 04:10
-
-
Save scorta/58c9728e3f2a104f20c5354b6988a53e to your computer and use it in GitHub Desktop.
Get All Regex Match From Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetAllRegexMatchFromText(string regex, string text) | |
{ | |
Regex linkParser = new Regex(regex, RegexOptions.Compiled | RegexOptions.IgnoreCase); | |
string result = string.Empty; | |
foreach (Match m in linkParser.Matches(text)) | |
result += m.ToString() + "|"; | |
result = result.Remove(result.Length - 1, 1); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment