Your health care provider can diagnose a pinworm infection by simply finding the eggs. The most common way to collect the eggs involves swabbing the anal area with the sticky side of a piece of transparent cellophane tape.