Friends, Before me is the task to disassemble several thousand different printing forms. Fortunately, the differences in them are not very large (somewhere more parameters, somewhere less), somewhere added a column, etc. In general, the context can be understood where and what is located. those. very suggested for using the regular expression mechanism. But since this is not pure text, the context of a regular expression must be specified not only in the form of "precedes / follows after", but also in the form of direction - "above", "below".
And so I thought, maybe it is worth making (or maybe someone has already done it?) The possibility of specifying a direction (context) into the regular expression mechanism, which will make them even more powerful and expand their applicability.
You can go further and, for example, by finding the eyes in the picture, assume that it is in a certain ratio with other parts of the face, and write a regular expression to highlight patterns not only in texts, but also in images. And in the spaces. ')
Has anyone come across anything like this?