# Regularly Expressional Fractalations

Posted in Mathematics, Art

There’s something about fractals that humans find fascinating. They manage to contain a beautiful impression of infinity despite being not very difficult to create. These fractals have been produced by a very simple recipe:

1. Split a big square of pixels into 4 quadrants and label them 1 to 4
2. Repeat this process for each of the smaller squares and add the quadrant number to the label
3. Keep cutting the squares into 4 until you’ve gone as small as you want
4. Now we can use regular expressions to find and mark boxes with certain labels

I wrote a little bit of javascript that creates such fractals from regular expressions involving the digits 1, 2, 3 or 4. Have a play here and check out some examples below.

### [34]+2

Jamie Quinn was born in Glasgow and raised on a steady diet of music, technology and delicious food. He is now a full time PhD student at the University of Glasgow investigating fluid dynamics, solar physics and damn hot plasmas.