Announcement

Collapse
No announcement yet.

How do I replace BB code tags with wildcard variables in all posts?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I replace BB code tags with wildcard variables in all posts?

    I am importing a forum to vBulletin, and everything went fine except the BB Code tags in all the posts.

    Normally, I would run the following to replace the BB Tags in all the posts:

    Run this query, change 'old name' and 'new name' as needed.

    UPDATE post SET pagetext = REPLACE(pagetext, 'old name', 'new name')

    So for example:

    UPDATE post SET pagetext = REPLACE(pagetext, '[TAG1]', '[TAG3]')
    However, after the import, all of the BB tags are the tag name followed by 7 alphanumeric set of characters.

    This is what I'm trying to replace:

    Code:
    [TAG:12345678] will be replaced with [TAG]
    [TAG:abcdefgh] will be replaced with [TAG]
    [TAG:19uptu1w] will be replaced with [TAG]
    [TAG:2yh7cdu4] will be replaced with [TAG]
    [TAG:a1hf2bf2] will be replaced with [TAG]
    [TAG:a02nsaf0] will be replaced with [TAG]
    How do I run the above query with some wildcard variables so anything with [TAG:********] will be replaced with [TAG]

    If it matters, I'm running vBulletin 3.8.

    Thanks in advance.
    Last edited by beansbaxter; Fri 28th Mar '14, 8:39am.
    PNW Moto

Related Topics

Collapse

Working...
X