VB to XF migration issue with quoted text


We've recently migrated from VB to XF and have since noted an issue with converted posts. Our (converted) posts with quoted text now have the following BB code stored:

A regex find/replace would allow us to fix this and covert the BB code to match that of XF.

However, upon checking, it seems as if the associated ID has no correlation to the actual quoted post. In some cases, the ID is off by over 900.

Would XF or the community have any suggestions to resolve this... if even possible?