Add unit tests for our new regexp handling