Announcement

Collapse
No announcement yet.

remoewe all [content in url tags

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

  • remoewe all [content in url tags

    I would like to remove all [url%/url]
    how to do this?

    I've tried
    this:
    Code:
    UPDATE text SET rawtext = REPLACE(rawtext, '[URL%URL]', '')
    but it doesn't work?
    any idea how to mass remowe all url tags with content in this tag? with mysql query?

  • #2
    There isn't a supported method to do this. If you were to try and build a query, then you would need to use regular expressions in the query. The text you wrote above will be taken literally and will not match anything. %URL means nothing to MySQL.

    https://dev.mysql.com/doc/refman/8.0/en/regexp.html
    https://stackoverflow.com/questions/9033018/regexp-to-validate-url-in-mysql


    I suggest that you test this on copies of your database. The wrong query can make your data worthless.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      is this correct?

      Code:
      UPDATE text SET rawtext = REGEXP_REPLACE(rawtext, '\[url\](.*?)\[/\url\]', '')

      Comment


      • #4
        It looks like it would work for something in this format: [url]https://google.com[/url]

        It wouldn't work for this format: [url='https://google.com']Google[/url]

        You'd have to test it on a copy of your database.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X