'How can we write mySQL query to extract a particular substring (which is occurring more than 1 times in text) from text?

Suppose we have a table named "matters" in this table there are two columns named "id" and "text"

In-text column suppose this is text - "Hey Manager [mention_user: client_1], Hey Manager [mention_user: umbrella_client_1]"

o/p: clent_1 client_2

From this text, we have to extract "client_1" and "client_2"

And these mentioned user numbers can be more i.e. there can be 5 clients tagged also and we have to extract all these 5 mentioned in the text

And all these we have to do in .SQL file



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source