re = /(?s)(?:<td[^<]*>|\G(?!^))(?:<[^<]+>)?(?!\s+)([^<]*)(?:<[^<]+>)?/
str = '<table class="fiche_table_caracter"><tbody>
<tr>
<td class="caracteristique"><strong>Design</strong></td>
<td>Classique (full tactile)</td>
</tr>
<tr>
<td class="caracteristique"><strong>Système d\'exploitation (OS)</strong></td>
<td>iOS</td>
</tr>
<tr>
<td class="caracteristique"><strong>Ecran</strong></td>
<td>4,7\'\' (1334 x 750 pixels)<br />16 millions de couleurs</td>
</tr>
<tr>
<td class="caracteristique"><strong>Mémoire interne</strong></td>
<td>128 Go, 1 Go RAM</td>
</tr>
<tr>
<td class="caracteristique"><strong>Appareil photo</strong></td>
<td>8 mégapixels</td>
</tr>
</tbody>
</table>'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
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 Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html