added edge case, more test cases, starting regex