More regexp parsing.
Added tests.