Utente:Bot55/Incipit Divina Commedia

Da Wikipedia, l'enciclopedia libera.
Vai alla navigazione Vai alla ricerca

Per l'aggiunta del template {{Incipit Divina Commedia}} nelle pagine dei canti della Divina Commedia del sommo poeta (vedi esempio), ho utilizzato questa serie di regex tramite il Find & Replate di AWB. Per utilizzarlo copincollarlo (seleziona, Ctrl+C, Ctrl+V) opportunamente nel proprio file di impostazioni (generalmente "settings.xml")

<IRule xsi:type="Rule">
        <enabled_>true</enabled_>
        <Children>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>+ == Incipit ==</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>([^\=]+)([^\n]+)(.+)</replace_>
            <with_>$1== Incipit ==\n{{Incipit Divina Commedia|%%pagename%%}}

$2$3</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>IgnoreCase Singleline</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>\n eccessivi</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(.+)\n+== Incipit ==</replace_>
            <with_>$1

== Incipit ==</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>Cantica</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>\{\{Incipit Divina Commedia\|(Inferno|Purgatorio|Paradiso) - ([^\}]+)\}\}</replace_>
            <with_>{{Incipit Divina Commedia|$1|$2}}</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>IgnoreCase</regexOptions_>
          </IRule>
          <IRule xsi:type="InTemplateRule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Canto primo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto primo</replace_>
                <with_>1</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>Canto secondo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto secondo</replace_>
                <with_>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>Canto terzo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto terzo</replace_>
                <with_>3</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>Canto quarto</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto quarto</replace_>
                <with_>4</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>Canto quinto</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto quinto</replace_>
                <with_>5</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>Canto sesto</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto sesto</replace_>
                <with_>6</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>Canto settimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto settimo</replace_>
                <with_>7</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>Canto ottavo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ottavo</replace_>
                <with_>8</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>Canto nono</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto nono</replace_>
                <with_>9</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>Canto decimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto decimo</replace_>
                <with_>10</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>Canto undicesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto undicesimo</replace_>
                <with_>11</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>Canto dodicesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto dodicesimo</replace_>
                <with_>12</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>Canto tredicesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto tredicesimo</replace_>
                <with_>13</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>Canto quattordicesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto quattordicesimo</replace_>
                <with_>14</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>Canto quindicesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto quindicesimo</replace_>
                <with_>15</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>Canto sedicesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto sedicesimo</replace_>
                <with_>16</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>Canto diciassettesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto diciassettesimo</replace_>
                <with_>17</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>Canto diciottesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto diciottesimo</replace_>
                <with_>18</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>Canto diciannovesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto diciannovesimo</replace_>
                <with_>19</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>Canto ventesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventesimo</replace_>
                <with_>20</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>Canto ventunesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventunesimo</replace_>
                <with_>21</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>Canto ventiduesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventiduesimo</replace_>
                <with_>22</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>Canto ventitreesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventitreesimo</replace_>
                <with_>23</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>Canto ventiquattresimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventiquattresimo</replace_>
                <with_>24</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>Canto venticinquesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto venticinquesimo</replace_>
                <with_>25</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>Canto ventiseiesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventiseiesimo</replace_>
                <with_>26</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>Canto ventisettesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventisettesimo</replace_>
                <with_>27</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>Canto ventottesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventottesimo</replace_>
                <with_>28</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>Canto ventinovesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto ventinovesimo</replace_>
                <with_>29</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>Canto trentesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto trentesimo</replace_>
                <with_>30</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>Canto trentunesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto trentunesimo</replace_>
                <with_>31</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>Canto trentaduesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto trentaduesimo</replace_>
                <with_>32</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>Canto trentatreesimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto trentatreesimo</replace_>
                <with_>33</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>Canto trentaquattresimo</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>Canto trentaquattresimo</replace_>
                <with_>34</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>IgnoreCase</regexOptions_>
              </IRule>
            </Children>
            <Name>Canto</Name>
            <TemplateNames_>
              <string>Incipit Divina Commedia</string>
            </TemplateNames_>
            <ReplaceWith_ />
            <DoReplace_>false</DoReplace_>
          </IRule>
        </Children>
        <Name>Incipit Divina Commedia</Name>
        <ruletype_>OnWholePage</ruletype_>
        <replace_ />
        <with_ />
        <ifContains_ />
        <ifNotContains_>==[ ]*Incipit[ ]*==</ifNotContains_>
        <regex_>true</regex_>
        <ifIsRegex_>true</ifIsRegex_>
        <numoftimes_>1</numoftimes_>
        <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
        <regexOptions_>IgnoreCase</regexOptions_>
      </IRule>