Add regex factory spec
Add linear function class