regex fixed, refactored the inputprocessor