You are using the match()
method. Try reading the documentation and you will see, that it returns only the first match.
Try the matches()
method instead, it returns a MatchCollection.
It would look something like this (careful, not tested written directly here)
string sample = "\n\n<#sample01#> jus some words <#sample02#> <#sample03#> just some words ";
MatchCollection mc = Regex.Matches(sample, "<#(.*?)#>");
foreach (Match m in mc)
{
Console.WriteLine(m.Groups[0]);
}
}