私は、機能的なテキストを探しているテキストブロックを解析する方法と、ANTLR(または類似のもの)だけを設定して利用することなく、テキスト内の空白を許す方法を知りたかった場合。構文解析で求められるのは、特定のアイテムのバリエーションだけです。.NETで特定の機能やパターンを探してテキストを解析し、空白を許す方法は?
例:以下の例では、Text、Required、およびTypeが存在する場合、その値が何であるかを調べたいと思います。それらはすべて存在するわけではありません。テキストブロック1と2では、興味のある値が解析されるときに、両方の項目の値が同じであることを知りたいと思います。 Textは "What is the label text"であり、Requiredは真であり、すべてのスペーシングを無視または許している間にTypeがヌルであるか指定されていない。
1. This is user entered text. {{Text="What is the label text {{ Ignore me and treat me as text }}?",Required=true }}. I am some more user added {} text.
2. This is user entered text. {{ Text ="What is the label text {{ Ignore me and treat me as text }}?", Required= True}}. I am some more user added {} text.
3. This is user entered text. {{Text="What is the label text?",Type=Date}}. I am some more user added {} text.
4. This is user entered text. {{ Text = "What is the label text?", Type = Date }}I am some more user added {} text.
5. This is user entered text. {{ Text = "What is the label text?", Type = Date, Required = True }}I am some more user added {} text.
なぜxmlやjsonを使用しないのですか? http://en.wikipedia.org/wiki/JSON –