Pattern validator