Yeah it’s called a regex. With a lot of human assistance it can do less but fits in smaller spaces and doesn’t break down.
It’s also deterministic, unlike llms…