I've been beating my head against this reg ex for the longest time now and am hoping someone can help. Basically I have a WYSIWYG field where a user can type formatted text. But of course they will copy and paste form word/web/etc. So i have a JS fucntion catching the input on paste. I got a function that will strip ALL of the formatting on the text which is nice, but I'd like to have it leave tags like p and br so it's not just a big mess.
Any regex ninjas out there? Here is what I have so far and it works. Just need to allow tags.
o.node.innerHTML=o.node.innerHTML.replace(/(<([^>]+)>)/ig,"");