strip_urls

NAME

strip_urls(): Strips URLs from given text, replacing them with an empty string.

TYPE

Function

DESCRIPTION

Strip out http:// and https:// URLs from given text. URLs are replaced with the empty string. Otherwise the text is untouched, and in particular, spaces are not compressed.

SYNOPSIS

strip_urls(txt TEXT CHARSET utf8)
  RETURNS TEXT CHARSET utf8

Input:

  • txt: an arbitrary text, possibly containing URLs

EXAMPLES

Strip both http:// and https:// URLs from text:

mysql> SELECT strip_urls('Check out common_schema: http://bit.ly/xKc8k3, an awesome project! https://bit.ly/Nd57HS') AS stripped;
+------------------------------------------------+
| stripped                                       |
+------------------------------------------------+
| Check out common_schema:  an awesome project!  |
+------------------------------------------------+

ENVIRONMENT

MySQL 5.1 or newer

SEE ALSO

replace_all()

AUTHOR

Shlomi Noach
 
common_schema documentation