I need to find every ocuring "<b>.......</b> blok in a text, even If this ocurs multiple times on 1 line.

example text:
<b>Inclus:</b> eau, \303\251lectricit\303\251 et <b>chauffage.</b>
responce should be:
<b>Inclus:</b>
<b>chauffage.</b>

I tryed some things with perl or shell:

echo '<b>Inclus:</b> eau, \303\251lectricit\303\251 et <b>chauffage.</ b>' | perl -ne 'print "$&\n" if m#<b>#i .. m#</b>#i'
give this output:
</b>

echo '<b>Inclus:</b> eau, \303\251lectricit\303\251 et <b>chauffage.</ b>' | perl -ne 'print "$&\n" if m/<b>.*<\/b>/g'
gives this output
<b>Inclus:</b> eau, électricité et <b>chauffage.</b>

some test with grep
echo '<b>Inclus:</b> eau, \303\251lectricit\303\251 et <b>chauffage.</ b>' | grep -o '<b>.*</b>'
gives this output
<b>Inclus:</b> eau, électricité et <b>chauffage.</b>

Is there somebody that can help me or point me in the right direction or tells me what I do wrong?

--

   .·€¨)
    ¸.·´¸.·´¨)     ¸.·*¨)   ¸.·´¨)
  (¸.·´   Thanks    .·´  .·´
          (_¸.·*   (¸.·*    (¸.·*´¯`*·€»

Bjorn Van Blanckenberg

Reply via email to