I've created a regex which would capture the string I need.
When I am testing regex on websites such as rubular.com then everything works, however when I put the same regex into REGEXP_SUBSTR
function then it doesn't work.
Here are 2 SQL examples (one with text in English and another one in Kristaps Porzingis' language):
SELECT regexp_substr('<ul data-error-code="REOPENED" data-unique-error-code="REOPENED"><li class="b">This is the text I would like to substr! <p class="tutorial" href="#">Other random text that I do not need</li></ul>'
,'<li class="b">([\wāēīšžģņļčķū:!,\b\s]+)<')
FROM dual;
SELECT regexp_substr('<ul data-error-code="REOPENED" data-unique-error-code="REOPENED"><li class="b">Šī ir valoda, ko lielākā daļa no jums nesaprot! <p class="tutorial" href="#">Other random text that I do not need</li></ul>'
,'<li class="b">([\wāēīšžģņļčķū:!,\b\s]+)<')
FROM dual;
I am trying to select text between <li class="b">
and next html tag, which in this case is <p class="tutorial">
.
Any advice on what am I doing wrong?