Using regular expression, I would like to capture only the value inside a tag:
<txt_conarq_assunto></txt_conarq_assunto>
Example:
Entry:
<txt_conarq_assunto>A classificar</txt_conarq_assunto>
Output:
Sorting
Using regular expression, I would like to capture only the value inside a tag:
<txt_conarq_assunto></txt_conarq_assunto>
Example:
Entry:
<txt_conarq_assunto>A classificar</txt_conarq_assunto>
Output:
Sorting
use the <[tag]>(.*?)</[tag]>
pattern to get content between elements. Replace [tag] with the actual element from which you want to extract the content
var texto = "<txt_conarq_assunto>A classificar</txt_conarq_assunto>";
texto.replace(/<txt_conarq_assunto>(.*?)<\/txt_conarq_assunto>/g, function(match, g1) { console.log(g1); });
You can use this expression:
(?s)(?<=\<txt_conarq_assunto>)(.*?)(?=\<\/txt_conarq_assunto\>)
Functional example: link
You can use /<txt_conarq_assunto>(.+?)<\/txt_conarq_assunto>/
See the example below, with javascript
var texto = "<txt_conarq_assunto>A classificar</txt_conarq_assunto>";
var m = texto.match( /<txt_conarq_assunto>(.+?)<\/txt_conarq_assunto>/ );
console.log(m[1]);