i am using SpeechRecognizer in c# . I want to use regular expression in grammerbuilder,here is my code.This code is not working.I want to pass any sentence example RE must pass 'this is stackoverflow', or any sentence or sentences.
Regex reg = new Regex(@"[a-z\-A-Z]*");
public Form1(){
InitializeComponent();
try{
SpeechRecognizer spec = new SpeechRecognizer();
Choices chose = new Choices();
chose.Add(reg.ToString());
GrammarBuilder gb = new GrammarBuilder();
gb.Append(chose);
Grammar gm = new Grammar(gb);
spec.LoadGrammar(gm);
spec.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs> (sre_SpeechRecognized);
spec.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>(sre_SpeechRejected);
}