Browse Source

Docs: Adjustments

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.10.0
Erez Sh 4 years ago
parent
commit
2af0ac2087
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      docs/classes.rst

+ 8
- 9
docs/classes.rst View File

@@ -11,15 +11,14 @@ Lark
Using Unicode character classes with ``regex``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Python’s builtin ``re`` module has a few persistent known bugs and also
won’t parse advanced regex features such as character classes. With
``pip install lark-parser[regex]``, the ``regex`` module will be
installed alongside ``lark`` and can act as a drop-in replacement to
``re``.

Any instance of ``Lark`` instantiated with ``regex=True`` will now use
the ``regex`` module instead of ``re``. For example, we can now use
character classes to match PEP-3131 compliant Python identifiers.
Python's builtin ``re`` module has a few persistent known bugs and also won't parse
advanced regex features such as character classes.
With ``pip install lark-parser[regex]``, the ``regex`` module will be
installed alongside lark and can act as a drop-in replacement to ``re``.

Any instance of Lark instantiated with ``regex=True`` will use the ``regex`` module instead of ``re``.

For example, we can use character classes to match PEP-3131 compliant Python identifiers:

::



Loading…
Cancel
Save