The set of all strings beginning with 101 and ending with 01010.

First, let's define our "context": we work with "labels are letters" (lal), on the alphabet $\{0, 1\}$. We don't use weights, or rather, we use the traditional Boolean weights: $\mathbb{B}$.

In [1]:

```
import vcsn
c = vcsn.context('lal_char(01), b')
c
```

Out[1]:

In [2]:

```
e = c.expression('(101[01]*)&([01]*01010)')
e
```

Out[2]:

In [3]:

```
a = e.automaton()
a
```

Out[3]:

and then we convert this automaton into a basic expression:

In [4]:

```
a.expression()
```

Out[4]:

Or, in ASCII:

In [5]:

```
print(a.expression())
```

I'd like to know if it's possible to match lines that don't contain a specific word (e.g. hede) using a regular expression?

First, let's define that alphabet we work on: from $a$ to $z$ for instance.

In [6]:

```
import vcsn
c = vcsn.context('lal_char(a-z), b')
c
```

Out[6]:

`_expression_.automaton`

), from which we extract a basic expression (with `_automaton_.expresion`

).

In [7]:

```
e = c.expression('(hede){c}')
e
```

Out[7]:

In [8]:

```
a = e.automaton()
a
```

Out[8]:

In [9]:

```
a.expression()
```

Out[9]:

`+`

is usually denoted `|`

; `\e`

denotes the empty word; and `[^]`

denotes any character, usually written `.`

):

In [10]:

```
print(a.expression())
```