···6969read back their updated `regex.lastIndex`.
70707171> **Note:** Sticky Regexes aren't natively
7272-> [supported in all versions of Internet Explorer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky#Browser_compatibility). `reghex` works around this by imitating its behaviour, which may decrease performance on IE11.
7272+> [supported in any versions of Internet Explorer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky#Browser_compatibility). `reghex` works around this by imitating its behaviour, which may decrease performance on IE11.
73737474This primitive allows us to build up a parser from regexes that you pass when
7575authoring a parser function, also called a "matcher" in `reghex`. When `reghex` compiles
···178178**nested abstract output**.
179179180180We can also see in this example that _outside_ of the regex interpolations,
181181-whitespaces and newlines don't matter.
181181+whitespace and newlines don't matter.
182182183183```js
184184import { parse } from 'reghex';
···200200`${/pattern/}`, or with other matchers `${name}`.
201201202202The tagged template syntax supports more ways to match these interpolations,
203203-using a regex-like Domain Specific Language. Unlike in regexes, whitespaces
204204-and newlines don't matter to make it easier to format and read matchers.
203203+using a regex-like Domain Specific Language. Unlike in regexes, whitespace
204204+and newlines don't matter, which makes it easier to format and read matchers.
205205206206We can create **sequences** of matchers by adding multiple expressions in
207207a row. A matcher using `${/1/} ${/2/}` will attempt to match `1` and then `2`
···210210211211| Operator | Example | Description |
212212| -------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
213213-| `?` | `${/1/}?` | An **optional** may be used to make an interpolation optional. This will mean that the interpolation may or may not match. |
214214-| `*` | `${/1/}*` | A **star** can be used to match an arbitrary amount of interpolation or none at all. This will mean that the interpolation may repeat itself or may not be matched at all. |
213213+| `?` | `${/1/}?` | An **optional** may be used to make an interpolation optional. This means that the interpolation may or may not match. |
214214+| `*` | `${/1/}*` | A **star** can be used to match an arbitrary amount of interpolation or none at all. This means that the interpolation may repeat itself or may not be matched at all. |
215215| `+` | `${/1/}+` | A **plus** is used like `*` and must match one or more times. When the matcher doesn't match, that's considered a failing case, since the match isn't optional. |
216216| `\|` | `${/1/} \| ${/2/}` | An **alternation** can be used to match either one thing or another, falling back when the first interpolation fails. |
217217-| `()` | `(${/1/} ${/2/})+` | A **group** can be used apply one of the other operators to an entire group of interpolations. |
218218-| `(?: )` | `(?: ${/1/})` | A **non-capturing group** is like a regular group, but whatever the interpolations inside it will match, won't appear in the parser's output. |
219219-| `(?= )` | `(?= ${/1/})` | A **positive lookahead** will check whether interpolations match, and if so will continue the matcher without changing the input. If it matches it's essentially ignored. |
220220-| `(?! )` | `(?! ${/1/})` | A **negative lookahead** will check whether interpolations _don't_ match, and if so will continue the matcher without changing the input. If the interpolations do match the mathcer will be aborted. |
217217+| `()` | `(${/1/} ${/2/})+` | A **group** can be used to apply one of the other operators to an entire group of interpolations. |
218218+| `(?: )` | `(?: ${/1/})` | A **non-capturing group** is like a regular group, but the interpolations matched inside it don't appear in the parser's output. |
219219+| `(?= )` | `(?= ${/1/})` | A **positive lookahead** checks whether interpolations match, and if so continues the matcher without changing the input. If it matches, it's essentially ignored. |
220220+| `(?! )` | `(?! ${/1/})` | A **negative lookahead** checks whether interpolations _don't_ match, and if so continues the matcher without changing the input. If the interpolations do match the matcher is aborted. |
221221222222We can combine and compose these operators to create more complex matchers.
223223For instance, we can extend the original example to only allow a specific set
···262262parse(name)('tim'); // undefined
263263```
264264265265-Lastly, like with regexex `?`, `*`, and `+` may be used as "quantifiers". The first two
265265+Lastly, like with regexes, `?`, `*`, and `+` may be used as "quantifiers". The first two
266266may also be optional and _not_ match their patterns without the matcher failing.
267267The `+` operator is used to match an interpolation _one or more_ times, while the
268268`*` operators may match _zero or more_ times. Let's use this to allow the `"!"`
···286286287287In the previous sections, we've seen that the **nodes** that `reghex` outputs are arrays containing
288288match strings or other nodes and have a special `tag` property with the node's type.
289289-We can **change this output** while we're parsing by passing a second function to our matcher definition.
289289+We can **change this output** while we're parsing by passing a function to our matcher definition.
290290291291```js
292292const name = match('name', (x) => x[0])`
···300300second argument. This will change the matcher's output, which causes the parser to
301301now return a new output for this matcher.
302302303303-We can use this function creatively by outputting full AST nodes, maybe like the
304304-ones even that resemble Babel's output:
303303+We can use this function creatively by outputting full AST nodes, maybe even like the
304304+ones that resemble Babel's output:
305305306306```js
307307const identifier = match('identifier', (x) => ({
···316316317317We've now entirely changed the output of the parser for this matcher. Given that each
318318matcher can change its output, we're free to change the parser's output entirely.
319319-By **returning a falsy** in this matcher, we can also change the matcher to not have
319319+By **returning a falsy value** in this matcher, we can also change the matcher to not have
320320matched, which would cause other matchers to treat it like a mismatch!
321321322322```js