added pattern to apply_regex()