// Field santitization. User interface stuff and not part of business logic.
        // Checks as text is typed in and prevents copy paste from violating what we want in the boxes.

        private void searchTextChanged(object sender, TextChangedEventArgs e)
        {
            if (!RegexMatch.CommonNameMatch((sender as TextBox).Text))
            {
                (sender as TextBox).Text = RegexReplace.MakeCommonName((sender as TextBox).Text);
            }
        }
 private void searchPreviewTextInput(object sender, TextCompositionEventArgs e)
 {
     e.Handled = !RegexMatch.CommonNameMatch(e.Text);
 }