Answer the question
In order to leave comments, you need to log in
What is the correct way to form a regular expression?
There is an XML response from the server, you need to extract two types of response from it. I don't get a very correct answer.
What is needed is that between the info blocks and remove cdata
I made such a decision. For some reason, it pulls out only the first option in a not very correct version, and then in duplicate <info><![CDATA[Отлично]]></info>
<info><![CDATA[Все ок]]></info>
Answer the question
In order to leave comments, you need to log in
Why regular expressions? You can work with the result of a query in the same way as with a DOM tree, so your code will look a little simpler:
success(data) {
document.querySelector('#result').innerHTML = Array
.from(data.querySelectorAll('info'), n => `<div>${n.firstChild.nodeValue}</div>`)
.join('');
},
select id_item from tablename where (prop = 'naz2' and val = 2) or (prop = 'naz1' and val = 1)
group by id_item
having count(0)=2
select id_item from tablename t1
join tablename t2 using(id_item)
where (t2.prop = 'naz2' and t2.val = 2) and (t1.prop = 'naz1' and t1.val = 1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question