Primo: make data extraction slightly more general

Now tested locally. Also added some comments etc.
I thought I mentioned this previously, but I don't see it now. That regexp is very obscure. You need to comment on what you're doing here. Chances are you don't want to be replacing random letters, but actual words.