I think we have a misunderstanding in communication. The query I posted above does exactly what you asked about in the very first post. It replaces [spoiler:127u0gij] with [spoiler] or [imgsize:12dd354] with [img]. It works like a charm. I hve used that many times for similiar purposes when converting the forums of some of my clients.