I wanted to try to match the inner part of the string between the span tags where it is guaranteed that the id of this span tags starts with blk.
How can I match this with groovy?
Example :
<p>I wanted to try to <span id="blk1">match</span> the inner part of the string<span id="blk2"> between </span>the span tags <span>where</span> it is guaranteed that the id of this span tags <span id="blk3">starts</span> with blk.</p>
According to the example above,I want to have
match
between
starts
I tried the following , but it returns null;
def html='''<p>I wanted to try to <span id="blk1">match</span> the inner part of the string<span id="blk2"> between </span>the span tags <span>where</span> it is guaranteed that the id of this span tags <span id="blk3">starts</span> with blk.</p>'''
html=html.findAll(/<span id="blk(.)*">(.)*<\/span>/).join();
println html;