added regex flag to allow item names in patterns match as regex patterns