grex is a really impressive tool that generates a small regex for a given set of string inputs: https://github.com/pemistahl/grex#53--examples-top-
There's a live instance you can play with at:
miniblog.
Related Posts
`init` feels like an unhelpful name in OO. It doesn't give you an initial value, it initialises the instance that has already been created. Developers are often surprised that init doesn't return the instance, because they have a strong association with `new Foo()`.
Perhaps `finish` would have been a less confusing name?
In Python I can choose any name for my instance variable when defining a method. In practice people almost always use `self`.
Go has the same flexibility, but using other names for the instance is totally normal!
Another nice feature of OO in Common Lisp: you initialise your class instance with the function initialize-instance.
So many languages define a 'construct' as a method that has access to the current instance, which is really kinda confusing (c.f. __init__ and __new__ in Python).