US 201515128150 A description in the following exemplary embodiments are disclosed with reference to figures of a drawing fig2 shows a flow diagram for a method for text recognition fig3 shows further steps of the method for text recognition fig4 shows an example for a graph model representation fig5 shows a flow diagram for creating a confidence matrix fig1 shows an example of a confidence matrix confmat of a short script sequence which is shown below the confmat the confmat contains the digit channels 0 9 and the nac channel the darker the field at a position the higher the confidence for a certain symbol black equals 1 0 and white equals 0 0 in other embodiments the confidence matrix may additionally contain a set of letters e g a to z as well as a to z punctuation marks and or control signs in fig2 a flow diagram for text recognition is shown in step 1 a confidence matrix of an input sequence is provided the confidence matrix is a digital representation of the input sequence the input sequence can be a written text or a spoken text an input of a regular expression is registered in step 2 in step 3 a symbol sequence that matches the regular expression is searched in the input sequence for the search a score value is computed using confidence values of the confmat step 4 fig3 shows an exemplary embodiment for recognizing text an input sequence e g written text or spoken text is transformed in a confidence matrix 14 details.