I am looking at a challenge with my very basic (near to none) experience of scripting, that goes like this:
I need a script that could search through my story/selection and look for patterns (such as four digits in a row, basic RegEx stuff) and add a specific Tag-element with some specific attributes and given values that would be taken from the found pattern.
EXAMPLE: (Searching the text below)
Product 7352 price 23,60
Now the script would find: 7352 and tag it  and give it attributes like RecordID = 7352 and Field = PRODUCTNR
For the price it would find the 23,60 and give it the same RecordID = 7352 and Field = PRICE.