{
    "componentChunkName": "component---src-templates-doc-page-js",
    "path": "/docs/en/Patterns/base_patterns/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Gatsby-doc-engine"}},"markdownRemark":{"id":"11a12e08-d11e-5860-8cb1-88b639a72cf6","excerpt":"Basic Patterns Elements *  — any (possibly zero-length) sequence of characters. How to use word  — the specified word, checked against the request character-by…","html":"<h1>Basic Patterns Elements</h1>\n<hr>\n<h3>*</h3>\n<p><code class=\"language-text\">*</code> — any (possibly zero-length) sequence of characters.</p>\n</br>\n<h5>How to use</h5>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span> catchAll\n        <span class=\"token storageType\">q!:</span> *\n        <span class=\"token variableParameter\">a:</span> I don’t understand you.</code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span> start\n        <span class=\"token storageType\">q!:</span> * \n        <span class=\"token variableParameter\">a:</span> Let’s get started!\n        <span class=\"token variableParameter\">go!:</span> /SecondStep</code></pre></div>\n</br>\n<h3>word</h3>\n<p><code class=\"language-text\">word</code> — the specified word, checked against the request character-by-character and in accordance with its position in the phrase.</p>\n</br>\n<h5>How to use</h5>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span>\n    <span class=\"token storageType\">q!:</span> hello\n    <span class=\"token variableParameter\">a:</span> Hello! What's up?</code></pre></div>\n</br>\n<h3>* stem *</h3>\n<p><code class=\"language-text\">*stem*</code> —  stemma: checks if the word contains the given character sequence.</p>\n<p>Asterisks can be placed:</p>\n<ul>\n<li>In the beginning, to denote a variable prefix: the pattern <code class=\"language-text\">*put</code> will match <code class=\"language-text\">input</code>, <code class=\"language-text\">output</code>, <code class=\"language-text\">put</code>.</li>\n<li>In the end, to denote a variable suffix: the pattern <code class=\"language-text\">put*</code> will match <code class=\"language-text\">putting</code>, <code class=\"language-text\">putter</code>, <code class=\"language-text\">put</code>.</li>\n<li>Both in the beginning and in the end, to denote variable prefixes and suffixes: the pattern <code class=\"language-text\">*put*</code> will match <code class=\"language-text\">outputting</code>, <code class=\"language-text\">put</code>.</li>\n</ul>\n</br>\n<h5>How to use</h5>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span>\n    <span class=\"token storageType\">q:</span> * *info* * <span class=\"token comment\">// will match \"info\", \"information, \"metainfo\"</span>\n    <span class=\"token variableParameter\">a:</span> More information is available at http://example.cn</code></pre></div>\n</br>\n<h3>(word1|word2|or a phrase)</h3>\n<p><code class=\"language-text\">(word1|word2|or a phrase)</code> — alternatives: checks whether the request contains any of the given alternatives.</p>\n<p>The options are separated by either <code class=\"language-text\">|</code> or <code class=\"language-text\">/</code>. They may recursively contain any other embedded pattern elements.</p>\n</br>\n<h5>How to use</h5>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span>\n    <span class=\"token storageType\">q:</span> (hello | good* (morning/day/evening) | greet* )\n    <span class=\"token variableParameter\">a:</span> Hiya!</code></pre></div>\n</br>\n<h3>[an optional word|or another phrase]</h3>\n<p><code class=\"language-text\">[an optional word|or another phrase]</code> — options: elements within square brackets need not be present within the request.</p>\n<p>If they are, the weight of the pattern is increased.</p>\n<p>Alternatives with options are also supported.</p>\n</br>\n<h5>How to use</h5>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span> How many players\n    <span class=\"token storageType\">q:</span> * {(how [many|much]) (gamer*|player*|people) [can] [play]} *\n    <span class=\"token storageType\">q:</span> * [game] for one * [or] [many] *\n    <span class=\"token storageType\">q:</span> * {([game]|in the game) [is] [there] (multiplayer [mode]|for several player*)} *\n    <span class=\"token variableParameter\">a:</span> This is a single-player adventure.</code></pre></div>\n</br>\n<h3>{word1 word2 (1|2)}</h3>\n<p><code class=\"language-text\">{word1 word2 (1|2)}</code> —  permutations: checks whether its elements are contained within the request in any order.</p>\n<p>Permutation elements are separated by spaces.</p>\n<p>Any element may recursively contain other pattern elements to an arbitrary level of embedding.</p>\n<p class='tip'>You should include no more than 5-6 elements into permutations.</p>\n</br>\n<h5>How to use</h5>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">state:</span> How much gameplay\n    <span class=\"token storageType\">q:</span> * {(how [much|many]) gameplay} *\n    <span class=\"token storageType\">q:</span> * {[how] (big|great) [is] [the] [game]} *\n    <span class=\"token variableParameter\">a:</span> The script for this game took about 2 thousand pages!</code></pre></div>","frontmatter":{"title":"","description":null},"headings":[{"value":"Basic Patterns Elements"}]}},"pageContext":{"slug":"/docs/en/Patterns/base_patterns/","previous":{"fields":{"slug":"/docs/en/Patterns/converters/"},"frontmatter":{"title":"","description":null}},"next":{"fields":{"slug":"/docs/en/Patterns/advanced_patterns/"},"frontmatter":{"title":"","description":null}}}},
    "staticQueryHashes": ["1209419333"]}