Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| // <Snippet7> | |
| using System; | |
| using System.Text.RegularExpressions; | |
| public class Example | |
| { | |
| public static void Main() | |
| { | |
| string pattern = @"\b(?!un)\w+\b"; | |
| string input = "unite one unethical ethics use untie ultimate"; | |
| foreach (Match match in Regex.Matches(input, pattern, RegexOptions.IgnoreCase)) | |
| Console.WriteLine(match.Value); | |
| } | |
| } | |
| // The example displays the following output: | |
| // one | |
| // ethics | |
| // use | |
| // ultimate | |
| // </Snippet7> |