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 such substring

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -