public void TagDigits(PhraseNode phrase) { if (phrase == null) { return; } foreach (var word in phrase.GetPhrase()) { if(Regex.IsMatch(word.Text, @"\d+")) { word.Tag = PartOfSpeechTag.Digit; } } }