I have an HTML content I am reading the HTML in Perl and want to catch only the words inside the tag i.e:
<span id="f002">From fairest creatures we desire increase,</span><br/>
<span id="f003">That thereby beauty’s rose might never die,</span><br/>
<span id="f004">But as the riper should by time decease,</span><br/>
<span id="f005">His tender heir might bear his memory:</span><br/>
<span id="f006">But thou contracted to thine own bright eyes,</span><br/>
<span id="f007">Feed’st thy light’s flame with self-substantial fuel,</span><br/>
<span id="f008">Making a famine where abundance lies,</span><br/>
<span id="f009">Thy self thy foe, to thy sweet self too cruel:</span><br/>
<span id="f010">Thou that art now the world’s fresh ornament,</span><br/>
<span id="f011">And only herald to the gaudy spring,</span><br/>
<span id="f012">Within thine own bud buriest thy content,</span><br/>
<span id="f013">And tender churl mak’st waste in niggarding:</span><br/>
<span id="f014">Pity the world, or else this glutton be,</span><br/>
<span id="f015">To eat the world’s due, by the grave and thee.</span>
I want to catch each and every words inside the span
tag,
I have tried :
([\w|’|-]+)([\W])
But its matching the tag names also as words, check here: https://regex101.com/r/mD3qG4/3 kindly suggest some regex to achieve this
thanks