Refactored.
Added regexp test.
Added test for missing required argument. Refactored.