regex - RegExp in mysql for field -
i have following query:
select item table which gives me:
<title>titanic</title> how extract name "titanic" this? like:
select re.find('\>(.+)\>, item) table what correct syntax this?
by default, mysql not provide functionality extracting text using regular expressions. can use regexp find rows match >.+<, there no straightforward way of extracting captured group without additional effort, such as:
- using library
lib_mysqludf_preg - writing own mysql function extract matched text
- performing regular string manipulation
- using regex functionality of whatever environment you're using mysql (e.g. php's
preg_match) - reconsidering need regular expressions entirely. if know rows contain
<title>tag, instance, may better idea use "normal" string functions suchsubstring
Comments
Post a Comment