regex and threading examples