I am well aware that this is an unusual thing I'm looking to do here, but just trust me, yes I do need to do this. It's all about pattern matching within the raw html (same as view source) for a web page.
If a user selects some text in a web browser, I want to be able to say - that selection is at position (say) 1234, (or there abouts) within the string that would make up the view source for a document.
The main problem is that all the information you can get around the user selection is related to the DOM representation of the document html, which is not the same as the view source (raw html).
I can get a fair bit of information client side, I'm thinking I'm going to have to pass this back server side and do some fuzzy logic type stuff to workout roughly where in the raw html the selection relates.
I don't have much of experience of 'inferred' decision making within a program.
Can anyone make a helpful suggestion about how this might be approached (Cos my brain's smoking a bit!).