added flag parser method.
fixed pattern match bug.
removed 'regex' property.