Structured pattern search: basic approach