1. A computer-implemented pattern edge detecting method comprising: acquiring image data of an inspection pattern from an imaging device and detecting edge points in an image of the inspection pattern; generating, by a computer, a plurality of edge lines from the edge points using a grouping process; generating, by a computer, a plurality of edge line group pairs, each of which is composed of a combination of first and second edge line groups to be a candidate of any of one and the other of an outside edge and an inside edge of the inspection pattern to each other, dividing the plurality of generated edge lines into two parts in different manners; performing, by a computer, shape matching between the first and second edge line groups for each edge line group pair, during the shape matching a matching score being obtained; and specifying, by a computer, as an edge of the inspection pattern, one of the first and second edge line groups constituting the edge line group pair whose matching score is best of the matching scores of the edge line group pairs.