The 4th amendment protection against unreasonable searches forbids officers from approaching on the street and randomly searching through pockets and jackets. Such unreasonable searches would be a violation of an individual's privacy interests and constitutional rights. However, in certain situations, the law does give officers some leeway when using a patdown technique, often called a street frisk.
A street frisk, or pat down "terry stop" is where an officer detains an individual (stops them temporarily) and uses flat palms to pat down the outer clothing of the person. The officer is typically seeking the easily recognizable shape of a gun or weapon. Using fingers or manipulating items though the fabric is typically not allowed, as it comes too close to the a search.
If a weapon is recognized, the officer may then proceed by arresting the individual and removing the item from his or her pocket. A full search is then conducted through a Search Incident to Arrest.
Often, while only using flat palms to pat down a person, the officer will claim to recognize other items, such as drug pipes or bags of drugs. Depending on the circumstances, the officer can make the arrest similar to the above gun example, based on the probable cause of finding the contraband and making the arrest.
The evolving law of pat down frisks began with the case, Terry v Ohio, which set forth the criteria and guidelines behind the stop and frisk searches, allowing them in limited situations without a warrant. Since then, the law has evolved to allow great flexibility in searches without warrants. In the criminal defense context, the pat down search is generally an area to explore in determining whether there was a violation of any 4th amendment searches and rights.