Transforming patterns into other patterns is kind of Stephen Wolfram's _thing_. See his long term interest in cellular automata, and now even an attempt to discover the secrets of the universe through a theory of physics based (as far as I can tell from what I've read of it) entirely on pattern matching and rewriting:
https://www.wolframphysics.org/.