Skip to content

Instantly share code, notes, and snippets.

Created December 3, 2018 11:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
MariaDB [(none)]> select regexp_replace('<img src="" alt="" width="233" height="300" class="alignnone size-medium wp-image-3517" />','(?<!<a href=[^>]*>)(<img src=.*wp-image-(\\d+)[^>]*>)','<a href="\\2" rel="attachment wp-att-\\2">\\1</a>') as regexp_replace_result;
ERROR 1139 (42000): Got error 'lookbehind assertion is not fixed length at offset 18' from regexp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment