Our Petscan query specifies the template and SPARQL query we are cross referencing, and outputs as Wiki. You can see that output here: http://petscan.wmflabs.org/?psid=7646047 (The query may take a while, but it will complete, just be patient!) To get the Wiki output, you will need to change the Output tab to Wiki.
Once you have that Wiki formatted template, you can use the following regular expressions to get rid of all that formatting. Be very careful to select only the characters, and not the whole paragraph line break, or it won't work!
To get rid of the QID text:
To get rid of the trailing numbers:
To get rid of the line break text:
If you are unfamiliar with regular expressions, try watching a few quick videos and you will see how powerful they are. I recommend using TextWrangler and doing a search for: "regular expressions textwrangler" though you can probably do the same with any code text editor.