Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| // <Snippet8> | |
| using System; | |
| using System.Text.RegularExpressions; | |
| public class Example | |
| { | |
| public static void Main() | |
| { | |
| string pattern = @"\b\w+\b(?!\p{P})"; | |
| string input = "Disconnected, disjointed thoughts in a sentence fragment."; | |
| foreach (Match match in Regex.Matches(input, pattern)) | |
| Console.WriteLine(match.Value); | |
| } | |
| } | |
| // The example displays the following output: | |
| // disjointed | |
| // thoughts | |
| // in | |
| // a | |
| // sentence | |
| // </Snippet8> |