Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (12 sloc) 891 Bytes

Pattern-matching mathematical expressions

Numbas includes a sophisticated pattern-matching algorithm for mathematical expressions. The algorithm decides whether an input expression matches a given pattern, and also identifies named matching groups, which are sub-expressions of the input expression.

Pattern-matching is used to power the :ref:`simplification rules <simplification-rules>`, as well as to establish the form of mathematical expressions entered by the student.

The pattern-matcher should be considered to work similarly to a regular expression algorithm, except it operates on algebraic syntax trees instead of text strings.

.. toctree::
    :caption: Pattern-matching
    :maxdepth: 2

You can’t perform that action at this time.