WOLFRAM|DEMONSTRATIONS PROJECT

Generating Fractals with Regular Expressions

​
steps
3
regex
.*?1(.p*)
This Demonstration shows fractal structures generated by regular expressions. Starting with the array
A=
2
1
3
4

, each integer
n
is replaced by the
2×2
array formed by prepending
n
to the elements of
A
,
22
21
12
11
23
24
13
14
32
31
42
41
33
34
43
44
,
and the process repeats a number of steps. Then, the elements of the array are evaluated using a regular expression, and colored according to the number of digits that match the selected regular expression.