Hey, I struggled with this regex and I have no ideas. I have these types of strings (not all of them are here, but only these 2 types), and I need to extract the part between the th tags .
<th class="tip" title='manje'>manje</th>
<th class="tip" title='ne d.'>ne d.</th>
<th class="tip" title='manje'>manje</th>
<th class="tip" title='točno'>točno</th>
<th class="tip" title='više'>više</th>
<th class="tip" title='m./t.'>m./t.</th>
<th class="tip" title='v./t.'>v./t.</th>
<th class="tip">daje</th>
<th class="tip">X2</th>
<th class="tip">12</th>
I tried some combinations of bu, I get the value only if the th tag does not have this "title" attribute.
This template retrieves content only if the th tag does not have the "title" attribute:
Pattern pattern = Pattern.compile("<th class=\"tip\"[\\s*|[.]{0,20}]>(.*?)\\s*</th>");
It's the same:
Pattern patternType = Pattern.compile("<th class=\"tip\"[\\s*|[.]{0,20}]>(.*?)\\s*</th>");
Any suggestions? Tnx
source
share