package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?s)(\G|<p class="oyric">)((?!</p>).)*?\K((?<=>)\h+|\h+(?=<|\h))`)
var str = ` <div align="justify">
<table width="552" border="0">
<tr>
<td><h1 class="article" itemprop="name">Modals</h1></td>
</tr>
<tr>
<td class="text_dreapta">On February 25, 2011, in <a href="modals.html" title="View all articles from Modals" class="external" rel="category tag">Destiny</a>, by Roland Worrior</td>
</tr>
</table>
<p class="text_obisnuit2"><em>Should I stay or should I go?</em></p>
<p class="oyric"> Laurie Strode comes to her final confrontation with Michael Myers, the masked figure who has haunted her since she narrowly escaped. </p>`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/