A method for recognition of a handwritten pattern comprises selecting core points among a sequence of detected points of the handwritten pattern. The core points are selected for use in segmenting and recognizing the handwritten pattern. The method further comprises determining features of each core point, and comparing the handwritten pattern to templates. The comparing comprises stepwise analyzing the core points in sequence by matching the features of sequences of core points that either start with the first core point or the last core point of a previous sequence to said templates and calculating a distance value, and assigning a cumulative distance value to the last core point in the matched sequence of core points, whereby a smallest cumulative distance value is assigned to the last core point and corresponds to a sequence of matched templates which represent a possible recognition result of the handwritten pattern.