Utilisateur:Tractopelle-jaune/Config AWB

Une page de Wikipédia, l'encyclopédie libre.

Règles perso AWB (regex) pour indentation infobox :

Il existe deux possibilités pour importer ces règles dans AWB :

  • Copier-coller le gros pavé de code directement dans la fenêtre des règles de remplacement "Advanced settings" ;
  • Copier-coller le code indenté disponible plus-bas dans le fichier de config d'AWB.

Pour ajouter les règles regex requises, le plus simple est de copier-coller les code ci-dessous, et de les coller, avec CTRL + V dans la fenêtre des règles de remplacement "Advanced settings" (les codes ci-dessous ont été générés par simple CTRL + C depuis la fenêtre "Advanced settings" d'AWB).

Il est aussi possible d'ajouter le code indenté disponible plus bas, à mettre directement dans le fichier de config d'AWB.

Fonctionnement

Le principe de fonctionnement est le suivant :

  1. On supprime les éventuels caractères tabulation \t présents (rare, mais pas inexistants, et sources de problèmes)
  2. On "encode" en @|@ tous les | présents à l’intérieur de modèles inclus dans l'infobox (évite d'indenter les paramètres des modèles inclus).
  3. On supprime tous les espaces non significatifs de l'infobox, et en même temps les paramètres de l'infobox sont encodés et précédés du code @XER@ (le mot XER n'a pas de signification particulières, mais je l'utilisais déjà dans un ancien script PHP, d'où son utilisation).
  4. On indente progressivement, sur la base du paramètre le plus long (plage autorisée : 2 à 30 caractères max pour les noms de paramètres, au-delà, pas géré pour le moment). L'indentation fonctionne sur le principe qu'il existe 29 sous-règles d'indentation, elles seront progressivement utilisées jusqu’à la règle correspondant au paramètre le plus long de l'infobox, qui est déterminé dans l'onglet "If", Ensuite, la règle de remplacement est exécutée plusieurs fois, grâce au paramètre "Apply No. of times", réglé sur 50 (réglage très large), d'utilité rare, mais bien utile ici. À chaque itération, un espace est ajouté à tous les paramètres n'ayant pas atteint la longueur du paramètre le plus long.
  5. Ensuite, une règle de finalisation est appliqué, qui va ajouter un espace avant et après le signe =, et qui va aussi restaurer le nom du paramètre.
  6. Une règle ajoute ensuite systématiquement un retour à la ligne final avant les accolades fermantes de l'infobox, afin de gérer le cas récurrent où les accolades fermantes sont collées au dernier paramètre. À noter que cette règle produit un effet de bord, en ajoutant systématiquement un retour à la ligne, même si déjà présent (il est plus simple de le retirer après si excédentaire que d'empêcher son ajout). Cet effet de bord éventuel est traité par une ultime règle séparée à la fin.
  7. Pour finir, on restaure les séparateurs de paramètres des sous-modèles qui avaient été encodés.
  8. Dernière règle, séparée du bloc, car devant s'exécuter en-dehors du contexte limité de l'infobox (la regex utilise dans son motif les accolades fermantes, qui ne sont pas accessibles à l'intérieur du bloc principale de règles, limité à l'infobox), une règle de nettoyage pour nettoyer les éventuels doubles retours à la ligne à la fin de l'infobox, effet de bord d'une autre règle.

ATTENTION : la plage de caractères acceptées pour les noms de paramètres des infobox est la suivante : [a-z_0-9 àäâéèêëîïôöúùûüœŒ'().,:;-] (insensible à la casse) Il est possible qu'il faille ajouter des caractères dans des cas particuliers.

Chez moi, j'utilise ces règles de manière permanente, je n'ai pas connus de faux-positifs, ou d'erreurs depuis leur mises en place.

NOTE : À noter qu'il n'est pas possible de marquer ce remplacement comme mineur (pas possible pour les règles "Advanced settings") pour permettre de sauter (skip) la page si d'autres modifications n'on pas été appliquées. Mais il est possible d'avoir un comportement très proche, en cochant la case "Only whitespace" dans l'onglet "Skip", cela permet de sauter le remplacement si seuls des modifications d'espaces blancs on été effectuées, ce qui est le cas des modifications d'indentation des infobox.

Code à coller dans la fenêtre des règles de remplacements "Advanced settings"

Règles principales :

<?xml version="1.0" encoding="utf-8"?><IRule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="InTemplateRule"><enabled_>true</enabled_><Children><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Prepare - Remove tab</Name><ruletype_>OnWholePage</ruletype_><replace_>\t</replace_><with_> </with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>false</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>None</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Prepare - Templates</Name><ruletype_>InsideTemplate</ruletype_><replace_>\|</replace_><with_>@!@</with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>false</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>None</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Supress align</Name><ruletype_>OnWholePage</ruletype_><replace_>\s*\|\s*([a-z_0-9 àäâéèêëîïôöúùûüœŒ'().,:;-]+?)\s*= *([^\n]*?) *</replace_><with_>\n@XER@$1=$2</with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>false</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>None</ifRegexOptions_><regexOptions_>IgnoreCase Multiline Singleline</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 2</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{2}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 3</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,2})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{3}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 4</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,3})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{4}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 5</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,4})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{5}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 6</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,5})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{6}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 7</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,6})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{7}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 8</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,7})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{8}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 9</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,8})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{9}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 10</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,9})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{10}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 11</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,10})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{11}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 12</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,11})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{12}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 13</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,12})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{13}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 14</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,13})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{14}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 15</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,14})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{15}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 16</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,15})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{16}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 17</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,16})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{17}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 18</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,17})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{18}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 19</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,18})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{19}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 20</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,19})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{20}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 21</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,20})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{21}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 22</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,21})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{22}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 23</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,22})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{23}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 24</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,23})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{24}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 25</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,24})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{25}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 26</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,25})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{26}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 27</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,26})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{27}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 28</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,27})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{28}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 29</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,28})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{29}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Align 30</Name><ruletype_>OnWholePage</ruletype_><replace_>(@XER@[^=\n]{1,29})=</replace_><with_>$1 =</with_><ifContains_>@XER@[^=\n]{30}=</ifContains_><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>50</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Finalization</Name><ruletype_>OnWholePage</ruletype_><replace_>@XER@([^=\n]+)=([^\n]?)</replace_><with_> | $1 = $2</with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>false</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>None</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Finalization - ajout retour à la ligne final</Name><ruletype_>OnWholePage</ruletype_><replace_>(\n *\| *[^|{}\n]+ *= *[^\n]*)$</replace_><with_>$1\n</with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>true</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>IgnoreCase</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule><IRule xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Restore - sub-templates</Name><ruletype_>InsideTemplate</ruletype_><replace_>@!@</replace_><with_>|</with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>false</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>None</ifRegexOptions_><regexOptions_>IgnoreCase</regexOptions_></IRule></Children><Name>Infobox - Indentation - Align</Name><TemplateNames_><string>Infobox .+</string></TemplateNames_><ReplaceWith_ /><DoReplace_>false</DoReplace_></IRule>

Règle de "ménage", à exécuter après :

<?xml version="1.0" encoding="utf-8"?><IRule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="Rule"><enabled_>true</enabled_><Children /><Name>Modèle - Suppression retours à la ligne excédentaires à la fin</Name><ruletype_>OnWholePage</ruletype_><replace_>^\n+\}\}</replace_><with_>}}</with_><ifContains_ /><ifNotContains_ /><regex_>true</regex_><ifIsRegex_>false</ifIsRegex_><numoftimes_>1</numoftimes_><ifRegexOptions_>None</ifRegexOptions_><regexOptions_>IgnoreCase Multiline</regexOptions_></IRule>

Code à ajouter directement dans le fichier de config

Autre variante possible, ajouter directement les règles suivantes dans le fichier de config d'AWB

Voici les règles, indentées, extraites depuis le fichier de config d'AWB :

<IRule xsi:type="InTemplateRule">
<enabled_>true</enabled_>
<Children>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Prepare - Remove tab</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>\t</replace_>
    <with_> </with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>false</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>None</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Prepare - Templates</Name>
    <ruletype_>InsideTemplate</ruletype_>
    <replace_>\|</replace_>
    <with_>@!@</with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>false</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>None</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Supress align</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>\s*\|\s*([a-z_0-9 àäâéèêëîïôöúùûüœŒ'().,:;-]+?)\s*= *([^\n]*?) *</replace_>
    <with_>\n@XER@$1=$2</with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>false</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>None</ifRegexOptions_>
    <regexOptions_>IgnoreCase Multiline Singleline</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 2</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{2}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 3</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,2})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{3}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 4</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,3})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{4}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 5</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,4})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{5}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 6</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,5})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{6}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 7</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,6})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{7}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 8</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,7})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{8}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 9</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,8})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{9}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 10</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,9})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{10}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 11</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,10})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{11}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 12</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,11})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{12}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 13</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,12})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{13}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 14</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,13})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{14}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 15</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,14})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{15}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 16</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,15})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{16}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 17</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,16})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{17}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 18</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,17})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{18}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 19</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,18})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{19}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 20</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,19})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{20}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 21</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,20})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{21}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 22</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,21})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{22}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 23</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,22})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{23}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 24</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,23})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{24}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 25</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,24})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{25}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 26</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,25})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{26}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 27</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,26})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{27}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 28</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,27})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{28}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 29</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,28})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{29}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Align 30</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(@XER@[^=\n]{1,29})=</replace_>
    <with_>$1 =</with_>
    <ifContains_>@XER@[^=\n]{30}=</ifContains_>
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>50</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Finalization</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>@XER@([^=\n]+)=([^\n]?)</replace_>
    <with_> | $1 = $2</with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>false</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>None</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Finalization - ajout retour à la ligne final</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>(\n *\| *[^|{}\n]+ *= *[^\n]*)$</replace_>
    <with_>$1\n</with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>true</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
  <IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Restore - sub-templates</Name>
    <ruletype_>InsideTemplate</ruletype_>
    <replace_>@!@</replace_>
    <with_>|</with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>false</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>None</ifRegexOptions_>
    <regexOptions_>IgnoreCase</regexOptions_>
  </IRule>
</Children>
<Name>Infobox - Indentation - Align</Name>
<TemplateNames_>
  <string>Infobox .+</string>
</TemplateNames_>
<ReplaceWith_ />
<DoReplace_>false</DoReplace_>
</IRule>

Règle de "ménage", à exécuter après :

<IRule xsi:type="Rule">
    <enabled_>true</enabled_>
    <Children />
    <Name>Modèle - Suppression retours à la ligne excédentaires à la fin</Name>
    <ruletype_>OnWholePage</ruletype_>
    <replace_>^\n+\}\}</replace_>
    <with_>}}</with_>
    <ifContains_ />
    <ifNotContains_ />
    <regex_>true</regex_>
    <ifIsRegex_>false</ifIsRegex_>
    <numoftimes_>1</numoftimes_>
    <ifRegexOptions_>None</ifRegexOptions_>
    <regexOptions_>IgnoreCase Multiline</regexOptions_>
</IRule>