The ALTernative Language
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Regular Expressions

The Regular expression feature is probably the most advanced feature of ALT. Standard regular expressions typically only operate on string data, but in ALT you can define regular expressions over any type of data.

Kleene algebra

Formally, regular expressions are a special case of the general Kleene algebra. ALT extends regular expressions with intersection and negation, implementing a regular language over values. As regular expressions are sequences in disguise, we’d rather speak of sequences than of regular expressions.

Concatenate

In ALT you can create a sequence by using the concatenate ; operator:

C1:
C2:
C3:
C4:
C5:

Intersect

You can check whether two sequences match by using the intersection & operator:

I1:
I2:
I3:

Union

And you can create alternative sequence elements or alternative sequences via the union | operator :

U1:
U2:
U3:

Double Star

And finally you can specify infinite sets of sequences with the (double) star ** operator.

S1:
S2:
S3:

Try to experiment with different operators, sequence sizes and value types to see what happens.