pattern iterator