How to get the value from a string via regular expression?

Good afternoon. Select the desired column and row name.
Example name
'<a href="/link/someId">Page number{thisId}</a>'
,
where someId and thisId dynamic.
I need to get only {thisId}, then to use to insert into another column.
September 19th 19 at 00:23
3 answers
September 19th 19 at 00:25
Solution
No: it can not be solved with standard tools MySQL.
It can be a long and hard to write multi-line SQL functions a we can solve the problem in a few lines on any JAP.
September 19th 19 at 00:27
And what is a regular expression?
Wykonywanie substr'om everything after the { and before }.
Well, not much. SUBSTR because we cut the length and after a certain length. But if someId is 2,3,4 sign? And also thisId. I can not understand, then give an example. - nikko.OKeefe12 commented on September 19th 19 at 00:30
: I do not understand: nobody in their right mind would do that on the muscle. - sean_Hilll commented on September 19th 19 at 00:33
With MySQL do not work, and later wrote that like it was there to do. But if you want specifically on SQL, something like this:

WITH t AS (SELECT 'Page No.{thisId}' x FROM DUAL)
SELECT SUBSTR (t.x
INSTR (t.x, '{'),
INSTR (t.x, '}') - INSTR (t.x, '{') + 1)
FROM t - Lee58 commented on September 19th 19 at 00:36
In the select tags ate the toaster, put out your expression. - Lee58 commented on September 19th 19 at 00:39
September 19th 19 at 00:29
<a href="https://toster.ru">Page №13</a>
preg_match with the condition:
if(preg_match('/№\<!--',$yourstring,$matches) ){
 // var_dump($matches);
 if ($matches) {
 do your thing
 }</property-->
<br / > In the $matches array is formed like, but some element of it will be 13
it is possible an example? - nikko.OKeefe12 commented on September 19th 19 at 00:32
: fixed the answer, he made an example of - sean_Hilll commented on September 19th 19 at 00:35
Well, it's in JAPANESE. Interested in the SQL language - Lee58 commented on September 19th 19 at 00:38
about sql, I have already answered - Lee58 commented on September 19th 19 at 00:41
: SQL language-no regular expressions, well, for this purpose, at least you had from the very beginning to design a database that would keep thisId in a separate column - nikko.OKeefe12 commented on September 19th 19 at 00:44
: thank you. I thought maybe it's possible. Clean the debris after previous owner - Eladio36 commented on September 19th 19 at 00:47
: mark "the decision" is welcomed )) - nikko.OKeefe12 commented on September 19th 19 at 00:50

Find more questions by tags MySQLSQLRegular expressions