refactor #parse regexp
take back #valid to simple way