chromedome has asked for the wisdom of the Perl Monks concerning the following question:
I am using a version of perl that is bundled into another application so I can not install any perl modules, I must use the standard out of the box perl that comes with my application.
The data I am working with is very strange (see below snippet). What I basically need to do is parse my data and look for any class= that does not have quotation marks and add them. Some class= have them and some don't. See below.
$string = qq( <LI>Donnez au client les renseignements sur le service&nbsp; +RVI de façon qu'il soit prêt au moment de demander les formulaires fiscaux.&nbsp; La +page Détails du système STAR contient maintenant les renseignements relatifs au système&nb +sp;RVI à l'intention des clients.</LI></OL> <TABLE class="interaction mceItemTable" border=0> <TBODY> <TR class=interaction_header> <TH colSpan=2>Interaction</TH></TR> <TR class=interaction_tr_even> <TD class=interaction_col1 width=80>Catégorie</TD> <TD>Year-End (Fin d'année)</TD></TR> <TR class=interaction_tr_odd> );
So class="interaction mceItemTable" would remain unchaged but stuff like class=interaction_header> and class=interaction_col1 width=80>Catégorie</TD> would look like class="interaction_header"> and class="interaction_col1" width=80>Catégorie</TD>
Any help is greatly appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange regex needed
by choroba (Cardinal) on Nov 19, 2014 at 23:21 UTC | |
by chromedome (Initiate) on Nov 19, 2014 at 23:41 UTC | |
by GrandFather (Saint) on Nov 20, 2014 at 00:16 UTC | |
|
Re: Strange regex needed
by MidLifeXis (Monsignor) on Nov 20, 2014 at 14:05 UTC |