Wikipedia:AutoWikiBrowser/Settings/Dab cleanup

<?xml version="1.0" encoding="utf-8"?>
<AutoWikiBrowserPreferences xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:space="preserve" Version="6.2.1.0">
  <Project>wikipedia</Project>
  <LanguageCode>en</LanguageCode>
  <CustomProject />
  <Protocol>http://</Protocol>
  <LoginDomain />
  <List>
    <ListSource>All disambiguation pages</ListSource>
    <SelectedProvider>CategoryListProvider</SelectedProvider>
  </List>
  <FindAndReplace>
    <Enabled>true</Enabled>
    <IgnoreSomeText>false</IgnoreSomeText>
    <IgnoreMoreText>false</IgnoreMoreText>
    <AppendSummary>true</AppendSummary>
    <Replacements />
    <AdvancedReps>
      <IRule xsi:type="Rule">
        <enabled_>false</enabled_>
        <Children />
        <Name>Notes</Name>
        <ruletype_>OnWholePage</ruletype_>
        <replace_>- Rules with * in the name use templates or parser functions. Rules with ** use substitution.
- Rules with (if) in the name have search strings on the "If" tab.

--------
Optimization:
- Instead of ( *.+), use (.+) (MUCH faster)
- To IGNORE matches found BETWEEN strings OPEN and CLOSE:
     match(?![^OC]*(?!OPEN)[^OC]*CLOSE) (faster than neg lookbehind)



</replace_>
        <with_ />
        <ifContains_ />
        <ifNotContains_ />
        <regex_>false</regex_>
        <ifIsRegex_>false</ifIsRegex_>
        <numoftimes_>1</numoftimes_>
        <ifRegexOptions_>None</ifRegexOptions_>
        <regexOptions_>None</regexOptions_>
      </IRule>
      <IRule xsi:type="Rule">
        <enabled_>true</enabled_>
        <Children>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Insert missing line break between entries</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(^\*+ *.*)(\*+ *.*)</replace_>
                <with_>$1
$2</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>No double spaces or tabs</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=[^\s-])( |	){2,}(?=[^\s-])</replace_>
                <with_> </with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>VISIBLE WHITESPACE (placeholder)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Double newline between sections (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=[^=}\n])\n(?==[=]+)</replace_>
                <with_>\n\n</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>INVISIBLE WHITESPACE (placeholder)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>"may refer to" 1</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^[^\*].*)(?&lt;!(commonly|mainly|(most )?often|ordinarily|primarily|principally|typically|usually) )((?&lt;also1&gt;(also )?)(?&lt;= )(may|can|could|might|is) (?&lt;also2&gt;(also )?)(be used to )?(?&lt;= )(refer to|be|mean)|(?&lt;also1&gt;(also )?)(?&lt;= )(refers to|is|means))( (any|one|any one|several|multiple|either))?( of)?( (a number of|the following|these))?( [\w ]+)?:? *\n</replace_>
                <with_>may ${also1}${also2}refer to:\n</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>IgnoreCase Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>"may refer to" 2</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(has|(may|can) have) (several |many )?(different |alternat(iv)?e )?meanings\.?(, including)?:?</replace_>
                <with_>may refer to:</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Drop "The word(s)"**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>The (expression|phrase|term|title|word)(s)? '''(?&lt;q&gt;['"]*)(?&lt;first&gt;\w)(?!['"]* may refer)</replace_>
                <with_>'''${q}{{subst:uc:${first}}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Add missing intro**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>^\s*([=;\*].*)</replace_>
                <with_>'''{{subst:PAGENAMEBASE}}''' may refer to:\n\n$1</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Rm NOTOC</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(__|\{\{)NO( )?TOC(__|\}\})\n</replace_>
                <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>Remove some dicdefs (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>^[^\[\]\n]* (is|are|means|is a(n)? .*(word|noun|(ad)?verb|adjective) (meaning|(often )?translated as)) [^\[\]\n]*\.\n</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>(if) wikt before intro (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;intro&gt;^'''.+)\n+(?&lt;wikt&gt;\{\{[Ww]ikt(ionary)?[^\{\}\n]*\}\})</replace_>
                <with_>${wikt}\n${intro}</with_>
                <ifContains_>\{\{[Ww]ikt</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline Singleline</regexOptions_>
              </IRule>
            </Children>
            <Name>INTRO (placeholder)**</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>(if) Comment out refs (revised)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;ref&gt;\&lt;[Rr]ef( +[\w ]+=[\w '"]+ *)*(\&gt;[^\&lt;\&gt;]*\&lt;/[Rr]ef\&gt;|/\&gt;))(?![^\&lt;\&gt;]*(?!\&lt;!--)[^\&lt;\&gt;]*--\&gt;)</replace_>
                <with_>&lt;!--${ref}--&gt;</with_>
                <ifContains_>&lt;[Rr]ef</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>(if) Comment ext links outside refs (revised)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;link&gt;\[?http[s]?://[^\s\[\]]+(?&lt;display&gt; [^\[\]]+(?=\]))?\]?)(?![^\&lt;\&gt;]*(?!\&lt;[Rr]ef[^\&lt;\&gt;]*\&gt;)[^\&lt;\&gt;]*\&lt;/ref\&gt;)(?![^\&lt;\&gt;]*(?!\&lt;!--)[^\&lt;\&gt;]*--\&gt;)</replace_>
                <with_>&lt;!--${link}--&gt;</with_>
                <ifContains_>http[s]?://</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Fix wikilinks+templates (SLOW?)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;![\[\{])(?&lt;open&gt;[\[\{]){2,3}(?&lt;content&gt;[^\[\]\}\}]*)(?&lt;close&gt;[\]\}]){1,3}(?![\]\}])</replace_>
                <with_>${open}${open}${content}${close}${close}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Un-nest nested comments</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(\&lt;!--[^\&gt;]*)\&lt;!--([^\&gt;]*)--\&gt;([^\&gt;]*--\&gt;)</replace_>
                <with_>$1$2$3</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>2</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children>
                  <IRule xsi:type="Rule">
                    <enabled_>false</enabled_>
                    <Children>
                      <IRule xsi:type="Rule">
                        <enabled_>false</enabled_>
                        <Children />
                        <Name>but don't duplicate</Name>
                        <ruletype_>OnWholePage</ruletype_>
                        <replace_>(?&lt;existing&gt;\{\{(([Tt][Oo][Cc]|[Cc]ontents)( float)?[- ]?([Rr]ight|RIGHT)|[Rr]ightTOC)\}\}) *\n*\{\{TOC right\}\}</replace_>
                        <with_>${existing}</with_>
                        <ifContains_ />
                        <ifNotContains_ />
                        <regex_>true</regex_>
                        <ifIsRegex_>false</ifIsRegex_>
                        <numoftimes_>1</numoftimes_>
                        <ifRegexOptions_>None</ifRegexOptions_>
                        <regexOptions_>Singleline</regexOptions_>
                      </IRule>
                    </Children>
                    <Name>+{{tocright}} if 4+ headers*</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>^(?&lt;pre&gt;[^=]*)(?=(?&lt;!\{\{([Tt][Oo][Cc][ _-]?(float)?[ _-]?[Rr](ight|IGHT)|[Cc]ontents[ _]right|[Rr]ightTOC)\}\}\n+)=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*)</replace_>
                    <with_>${pre}{{TOC right}}\n</with_>
                    <ifContains_>==</ifContains_>
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                </Children>
                <Name>Rm &lt;references/&gt; &amp; {{reflist}}</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>\n(&lt;[Rr]eferences[ ]*/&gt;[\n]+|\{\{([Rr]ef|[Nn]ote)list(\|[^\}]*)?\}\}\n)$</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Rm uncommented ref cleanup tags</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?:&lt;!--[.\n]*--&gt;)*(?&lt;!\&lt;!--[^\{]*){{([Rr]eferences|([Aa]d[d]?|[Bb]ad|[Cc]ite|[Cc]leanup|[Ff]ew|[Ii]mprove|[Mm]issing|[Mm]ore|[Nn]eeds( additional|more)?|[Nn]o[t]?|[Uu]n)(-| )?(cit|r|source|verif)[^\}]*|[Nn][Rr]|([Rr]ef(erence)?|[Cc]itation)[s]?[ ]?(needed|missing)?|[Rr]efim[^\}]*|[Ss]ources|[Rr]ip|\+[Rr])}}[\n]*</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>REFS/COMMENTS (placeholder)*</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>No bold after lead</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=^[\*=].*)'''(.*)'''</replace_>
            <with_>$1</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>3</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>Multiline</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>Indent with bullets</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=^:*):(?=/*)</replace_>
            <with_>*</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>Multiline</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Rm linkless non-parent entries</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>^(?&lt;stars&gt;\*+) *[^\[\]\{\}\n]*(?!: *)$\n(?!\k&lt;stars&gt;\*)</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Add colon to linkless parent entries</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^\n*\*+ *)(?&lt;text&gt;[^\[\]\{\}\n:]+[^ :]) *(?=$\n\*+)</replace_>
                <with_>${text}:</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
            </Children>
            <Name>If linkless entries: (SLOW)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_>^\*+ *[^\[\]\{\}\n]*$(?![^\&lt;\&gt;]*(?#Unless commented:)(?!\&lt;!--)[^\&lt;\&gt;]*--\&gt;)</ifContains_>
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>true</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>Multiline Singleline</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Except for known abbreviations</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;!\[\[[^\]]*(?!\]\][^\[]*))(?&lt;abbrev&gt; (etc|al|[Ii]nc|[Ll]td|[Cc]o|[JS]r|[Pp]lc))(?!\.)(?=\W*\n)</replace_>
                    <with_>${abbrev}.</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                </Children>
                <Name>(if) Rm end punctuation (SLOW?)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^\*+ *)(?&lt;text&gt;.*[^\.\n\s]{2,})(?:\.|;|,)(?&lt;peren&gt;\)?) *(?=\n+)</replace_>
                <with_>${text}${peren}</with_>
                <ifContains_>[\.;,]\)? *\n</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Cupola/punc to comma (RECENT CHANGE)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)(?&lt;term&gt;[^,\n]+[^,\n\-–—:; ]|[^,\n]*\[\[.+\]\](|[^,\n]*?[^,\n\-–—:; ]))(?#unless term is in quotes, parens, or a link:)(?![^'"\n]*(?!")[^'"\n]*"|[^'"\n]*(?!'')[^'"\n]*''|[^\(\)\n]*(?!\()[^\(\)\n]+\)|[^\[\]\n]*(?!\[\[)[^\[\]\n]+\]\])(, which)?((?&lt;!that) (is|are|was|were) | *([\–—]+|(?&lt;!\!)--(?!\&gt;)) *| *[:;\-] +(?=\w)|(?&lt;=\]\]|\}\}) (?=(a|an|the) ))</replace_>
                <with_>${term}, </with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Comma to semicolon in "; see [[x]]"</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *(?![Ff]or )[^\n]*) *(\-\-|[,;:\-–—\.]) *([Ff]or more information[,;:])? ?([Ss]ee|[Cc]f[\.]?)( also)?(?![^\&lt;\&gt;\!]*(?!\&lt;!--)[^\&lt;\&gt;\!]*--\&gt;) </replace_>
                <with_>; see </with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
            </Children>
            <Name>PUNCTUATION (placeholder)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Name>"formerly"</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>((which was )?formerly|which used to be)</replace_>
                <with_>formerly</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>false</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Name>Remove extra sentences (EXPERIMENTAL)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *.*?\w{3})\. +(?&lt;extra_sentences&gt;\p{Lu}.*)(?=\n)</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>SHORTEN DESCRIPTIONS (placeholder)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>fti based on link**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^\*+ *)(''|")?\[\[(?&lt;link&gt;(?&lt;main&gt;[^\|\]]*) \((?&lt;dabber&gt;([^\|\]]* )?(album|book|collection|comic|EP|film|game|LP|manga|movie|musical|novel|periodical|play|(television|[Tt]\.?[Vv]\.?) program(me)?|series|show|telenovela|(?&lt;!\w)work))\))(?!\|''\k&lt;main&gt;'' \(\k&lt;dabber&gt;\))(\|[^\]]+)?\]\](''|")?</replace_>
                <with_>{{subst:fti|${link}}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>ftq based on link**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^\*+ *)(''|")?\[\[(?&lt;link&gt;(?&lt;main&gt;[^\|\]]*) \((?&lt;dabber&gt;[^\|\]]*(?&lt;=\W)(episode|single|song|story|track))\))(?!\|"\k&lt;main&gt;" \(\k&lt;dabber&gt;\))(\|[^\]]+)?\]\](''|")?</replace_>
                <with_>{{subst:ftq|${link}}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>fti based on description (intricate)**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)(''|")?(?&lt;!'')((?&lt;islinked&gt;\[)\[)?(?&lt;target&gt;[^\[\|\]\n'" ][^\[\|\]\n]*?)(?!\|''[^\[\|\]\n]+'')(\]\])?(''|")?(?&lt;to_noun&gt;, (a(n(other)?)? )?(\d{3,4} )?([\w-]+ ?){0,5} (?&lt;!((class|kind|sort|type|variety|composer|critic|developer|director|distributor|editor|executive|host|illustrator|narrator|presenter|producer|publisher|star|writer) of( .*)?|.* (by|from|(with)?in|of|on) .*))(album|biopic|book|chronicle|comedy|documentary|drama|EP|film|franchise|board[ \-]?game|genus|LP|magazine|movie|mural|newspaper|novel(ette|la)?|painting|(?&lt;!(who|that|which) )play|(?&lt;!trade|air|to )show|soundtrack|genus|(television|[Tt]\.?[Vv]\.?) (program(me)?|series)|thriller|western|(?&lt;!t)work))(?!\w)(?!.*(?&lt;!.*(by|featuring|including|starring).*)(act(or|ress)|anchor|camera|channel|character|comedi(an|enne)|company|composer|critic|developer|director|distributor|editor|executive|festival|film(maker|ographer)|host|illustrator|industry|narrator|organi[sz]ation|personality|presenter|producer|publisher|retailer|seller|service|star|station|store|superhero|system|theat(er|re)|tournament|vendor|writer))</replace_>
                <with_>{{subst:fti|${target}|nolink={{subst:#if:${islinked}|0|1}}}}${to_noun}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>fti for species likely in Latin** (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)(''|")?(?&lt;!'')((?&lt;islinked&gt;\[)\[)?(?&lt;target&gt;\p{Lu}\.? [^\[\|\]\n]+)(?!\|''[^\[\|\]\n]+'')(\]\])?(''|")?(?&lt;to_noun&gt;, (a(n(other)?)? )?(\d{3,4} )?([\w-]+ ?){0,5}species(?!\w))</replace_>
                <with_>{{subst:fti|${target}|nolink={{subst:#if:${islinked}|0|1}}}}${to_noun}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>(if) ftq based on description** (intricate)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)(''|")?(?&lt;!")((?&lt;islinked&gt;\[)\[)?(?&lt;target&gt;[^\[\|\]\n'" ][^\[\|\]\n]*?)(\]\])?(''|")?(?&lt;to_noun&gt;, (a(n(other)?)? )?(\d{3,4} )?([\w-]+ ?){0,5}(?&lt;!((class|kind|sort|type|variety|composer|director|host|illustrator|lyricist|narrator|producer|star|writer) of( .*)?|.* (from|in) .*))(?&lt;!(,)? (and|or|based on|featuring) ([\w-]+ )+)(''.*'' (episode|finale)|(episode|finale) of.*(show|series|television|[Tt]\.?[Tv]\.?|''.*'')|poem|single.*(album|record(?!s)|EP|LP)|(?&lt;!album and )song(?! and album)| story(?! arc)|(?&lt;!sound)track(?!e).*(album|record[^s]|EP|LP))(?=\s))(?! ((act(or|ress)|anthology|comedi(an|enne)|collection|composer|director|host|illustrator|lyricist|narrator|producer|star|writer)))</replace_>
                <with_>{{subst:ftq|${target}|nolink={{subst:#if:${islinked}|0|1}}}}${to_noun}</with_>
                <ifContains_>(episode|finale|poem|single|song|story|track)</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>ftqi based on description** (intricate)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)["']*((?&lt;islinked&gt;\[)\[)?(?&lt;episode&gt;\p{Lu}[^\|\]]+) \((?&lt;series&gt;\p{Lu}[^\|\]]+)\)(\]\])?["']*(?=, (a(n(other)?)? )?(\d{3,4} )?([\w-]+ ?){0,5}episode of (the (television |[Tt]\.?[Vv]\.? )?(program(me)?|series|show) )?["'\[]*\k&lt;series&gt;["'\[]*)</replace_>
                <with_>{{subst:ftqi|${episode} (${series})|nolink={{subst:#if:${islinked}|0|1}}}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>LINK FORMATTING (placeholder)**</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>Use ship prefix templates*</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>\[\[(?&lt;prefix&gt;(AN|BN|EN|FN|G|GT|H|HDM|HM|HMA|HMB|HMC|HMNZ|HMQ|HMV|HNLM|HNoM|HSwM|HTM|IN|J|JD|M|NN|P|RM|ROK|RP|RS|S|SA|SM|US|USN|)S|BAP|BRP|HMT|HSC|Jsub|KRI|LÉ|MY|ORP|RFAux|RV|SMU|SV|TCG|USAT|USCGC|USRC) (?&lt;name&gt;[^\|\[\]\(\)]*)( \((?&lt;code&gt;[^\|\[\]\(\)]*)\))?(\|[^\|\]\n']+)?\]\]</replace_>
            <with_>{{${prefix}|${name}|${code}}}</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Remove any "a/an/the" before type</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>\(([Tt]he|[Aa]n?) (?&lt;type&gt;.*(callsign|code|designator|symbol|prefix|postfix|identifier|abbreviation))</replace_>
                    <with_>(${type}</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>false</enabled_>
                    <Children />
                    <Name>Language and country codes lowercase and in quotes*</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;=\(.*(ISO 639(-\d( and -\d)?)?|language|country).*(code|identifier)s? )(?&lt;code&gt;\{\{subst:uc:\{\{subst:PAGENAMEBASE\}\}\}\})(?=\))</replace_>
                    <with_>"{{subst:lc:{{PAGENAMEBASE}}}}"</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>false</enabled_>
                    <Children />
                    <Name>Substitute page name and case modifier</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;=\{\{)(?&lt;template&gt;uc:|lc:|PAGENAMEBASE)</replace_>
                    <with_>subst:${template}</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                </Children>
                <Name>CODE entries - move target to start and...**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^\*+ *)((?&lt;code&gt;[^,\s]*), )?(?:[Tt]he|[Aa]n)? ?(?&lt;type&gt;(\[\[|\{\{)?([^,\n]* )?(acronym|callsign|code(name)?|designator|symbol|prefix|postfix|identifier|abbreviation)s?(\]\]|\}\})?) (?:for|of) (?:the )?(?&lt;item&gt;[^\n]*[^\s])(\s)?$</replace_>
                <with_>${item} (${type} {{subst:#if:${code}|"${code}"|{{subst:#ifeq:${type}|abbreviation|"{{subst:PAGENAMEBASE}}"|{{subst:uc:{{subst:PAGENAMEBASE}}}}}}}})</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Alternate name - move target to start (NEW)**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)[Aa]n(other)?( alternat(?&lt;iv&gt;iv)?e)? (?&lt;noun&gt;name|title|designator|code) for (?&lt;target&gt;.*)</replace_>
                <with_>${target}, alternat${iv}ely called {{subst:uc:{{subst:PAGENAMEBASE}}}})</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Name>"from [[work]]" before "by [artist]" (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+.+)((?&lt;by&gt;by .*[^, ]),? (?&lt;ident&gt;[Aa]n? .*[^, ]),?|(?&lt;ident&gt;[Aa] (song|poem|single|(short )?story|track)),? (?&lt;by&gt;by .*[^, ]),?) from (?&lt;pospron&gt;his|her|their)? ?(the )?(?&lt;work&gt;.*\[\[.*\]\].*)</replace_>
                <with_>${ident} from {{subst:if:${pospron}|the |}}${work}, ${by}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>"[artist]'s [[work]]" to "[[work]] by [artist]" (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+.+)from (?&lt;artist&gt;.*)'s (?&lt;work&gt;.*\[\[.+\]\].*)</replace_>
                <with_>from the ${work} by ${artist}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Name>"In [field], [[item]]" to "[[Item]], in [field]" (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *)[Ii]n (?&lt;field&gt;[^,\n]*), (?&lt;entry&gt;\[\[[^\]\n]*\]\]) (is|are|was|were) </replace_>
                <with_>${entry}, in ${field}, </with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>WORD ORDER (placeholder)**</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>Don't pipe away disambiguators</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=\*+ *)\[\[(?&lt;base&gt;[^\]\|\)\n]+) (?&lt;dabber&gt;\([^\]\|\n]+\)) *\| *\k&lt;base&gt;\]\]</replace_>
            <with_>[[${base} ${dabber}]]</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>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Name>Remove extraneous bold</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(==[^\n']*)'''([^\n']*==)</replace_>
                <with_>$1$2</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>Pseudo-headers to real headers**</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?#Negative lookbehind here to ignore multiline comments made rule run very slowly)(?&lt;=(?&lt;parentlevel&gt;(?&lt;=\n=)=+).*?\n|^(?&lt;parentlevel&gt;)([^=]?[^\n]*\n)*?)(?!\&lt;!--)(; ?|(In (the )?)?'*|)(?&lt;title&gt;[^\*;'\n=\{ ][^\n]*[^\n=':;\.\-–— ])(?&lt;! (refer(s)? to|include(s)?|mean(s)?|is|are|was|were)(?!\w)[^\n]*)('{2,5})?[:;\-–— ]*('{2,5})?(?=(\n\(.*\))*\n+\*)</replace_>
            <with_>==${parentlevel}{{subst:ucfirst:${title}}}${parentlevel}==</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>Singleline</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Abbreviate US (except in links and headers)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;!==.*)((?&lt;U&gt;U\.?)(?&lt;S&gt;S\.?)A\.?|(?&lt;U&gt;United )(?&lt;S&gt;States)( of America)|(?&lt;U&gt;U)nited (?&lt;S&gt;S)tates(?! v.))(?![^\[\]]*(?!\[\[)[^\[\]]*\]\])</replace_>
                <with_>${U}${S}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>29</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Abbreviate UK (except in links and headers)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;!==.*)((?&lt;U&gt;U)\.(?&lt;K&gt;K)\.?|(?&lt;U&gt;U)nited (?&lt;K&gt;K)ingdom(?! of))(?![^\[\]]*(?!\[\[)[^\[\]]*\]\])</replace_>
                <with_>${U}${K}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Name>Replace c. in vital years w/tooltip template</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=[\(\-–—] ?)(\[\[circa\|)?(c|ca|circa|~|approx(imately)?)\.?(\]\])?(?= ?\d)</replace_>
                <with_>{{circa}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Replace fl. in vital years w/tooltip template</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\( ?)(\[\[floruit\|)?(fl|flr|flor)\.?(\]\])?(?= ?\d)</replace_>
                <with_>{{floruit}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>COMMON ABBREVIATIONS (placeholder)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>LC certain words at start of description (NEW)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=, )(A|An|The)(?= )(?![^\[\]]*(?!\[\[)[^\[\]]*\]\])</replace_>
                <with_>{{subst:lcfirst:$1}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>UC first letter of first word of entry**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=^[=;\*]+ *)(\[\[([^\n\|\]]*\|)?)?(?&lt;letter&gt;\p{Ll})(?!(?#punct)[.,;:\*]|(?#single letter not a)(?&lt;!a) |(?#French)(?&lt;=[dl])'|(?#Arabic)(?&lt;=a)l[- ]|(?#Greek)(?&lt;=[αβγδεζηθικλμνξοπρσςτυφχψω]).|(?#hidden)[^\n\|\[\]]*\|)</replace_>
                <with_>$1{{subst:uc:${letter}}}</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
            </Children>
            <Name>CAPITALIZATION (placeholder)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>(if) Unlink third+ links in entry**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *.*[^\[\{\n]*)(?&lt;link1&gt;\[\[(?&lt;target1&gt;[^\|\]]+)(\|[^\]]*)?\]\]|\{\{(?&lt;template1&gt;(AN|BN|EN|FN|G|GT|H|HDM|HM|HMA|HMB|HMC|HMNZ|HMQ|HMV|HNLM|HNoM|HSwM|HTM|IN|J|JD|M|NN|P|RM|ROK|RP|RS|S|SA|SM|US|USN|)S|BAP|BRP|HMT|HSC|Jsub|KRI|LÉ|MY|ORP|RFAux|RV|SMU|SV|TCG|USAT|USCGC|USRC)\|(?&lt;target1&gt;[^\}]+)\}\})(?&lt;inter&gt;[^\[\n]*)(?&lt;![Ss]ee |\&lt;!--(?!.*--\&gt;.*).*)(?&lt;link2&gt;\[\[(?&lt;target2&gt;[^\|\]]+\|)?(?&lt;display2&gt;[^\]]*)\]\]|\{\{(?&lt;template2&gt;(AN|BN|EN|FN|G|GT|H|HDM|HM|HMA|HMB|HMC|HMNZ|HMQ|HMV|HNLM|HNoM|HSwM|HTM|IN|J|JD|M|NN|P|RM|ROK|RP|RS|S|SA|SM|US|USN|)S|BAP|BRP|HMT|HSC|Jsub|KRI|LÉ|MY|ORP|RFAux|RV|SMU|SV|TCG|USAT|USCGC|USRC)\|(?&lt;target2&gt;[^\}]+)\}\})(?!\&lt;!--[acceptable|OK|keep link].*--\&gt;)(?&lt;rest&gt;[^\n]*)</replace_>
                <with_>${link1}${inter}{{subst:#ifexist:${template1} ${target1}|{{subst:trim|1=${template2} ${display2}}}|${link2}&lt;!--keep link only if first link red--&gt;}}${rest}</with_>
                <ifContains_>(?&lt;=\*+ *.*[^\[\{\n]*)(\[\[|\{\{)[^\[\{\n]+\[\[[^\[\{\n]+(\[\[|\{\{)</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>4</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>(if) Unlink 2nd link in entry (intricate)**</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=\*+ *.*[^\[\{\n]*)(?&lt;link1&gt;\[\[(?&lt;target1&gt;[^\|\]]+)(\|[^\]]*)?\]\]|\{\{(?&lt;template1&gt;(AN|BN|EN|FN|G|GT|H|HDM|HM|HMA|HMB|HMC|HMNZ|HMQ|HMV|HNLM|HNoM|HSwM|HTM|IN|J|JD|M|NN|P|RM|ROK|RP|RS|S|SA|SM|US|USN|)S|BAP|BRP|HMT|HSC|Jsub|KRI|LÉ|MY|ORP|RFAux|RV|SMU|SV|TCG|USAT|USCGC|USRC)\|(?&lt;target1&gt;[^\}]+)\}\})(?&lt;inter&gt;[^\[\n]*)(?&lt;![Ss]ee |\&lt;!--(?!.*--\&gt;.*).*)(?&lt;link2&gt;\[\[(?&lt;target2&gt;[^\|\]]+\|)?(?&lt;display2&gt;[^\]]*)\]\](?&lt;suffix2&gt;\w*)|\{\{(?&lt;template2&gt;(AN|BN|EN|FN|G|GT|H|HDM|HM|HMA|HMB|HMC|HMNZ|HMQ|HMV|HNLM|HNoM|HSwM|HTM|IN|J|JD|M|NN|P|RM|ROK|RP|RS|S|SA|SM|US|USN|)S|BAP|BRP|HMT|HSC|Jsub|KRI|LÉ|MY|ORP|RFAux|RV|SMU|SV|TCG|USAT|USCGC|USRC)\|(?&lt;display2&gt;[^\}]+)\}\})(?!\&lt;!--.*[acceptable|ok|OK|keep|second|link].*--\&gt;)(?&lt;rest&gt;[^\n]*)</replace_>
            <with_>${link1}${inter}{{subst:#ifexist:${template1} ${target1}|{{subst:trim|1=${template2} ${display2}${suffix2}}}|${link2}&lt;!--keep link only if first link red--&gt;}}${rest}</with_>
            <ifContains_>(?&lt;=\*+ *.*[^\[\{\n]*)(\[\[|\{\{)[^\[\{\n]+(\[\[|\{\{)</ifContains_>
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>true</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>Multiline</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>false</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>false</enabled_>
                <Children />
                <Name>(if) Unlink third+ links in entry**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\*+ *.*[^\[\{\n]*)(?&lt;link1&gt;\[\[(?&lt;target1&gt;[^\|\]]+)(\|[^\]]*)?\]\]|\{\{(?&lt;ship_type1&gt;[\p{L}/]{2,6})\|(?&lt;target1&gt;[^\}]+)\}\})(?&lt;inter&gt;[^\[\n]*)(?&lt;![Ss]ee |\&lt;!--(?!.*--\&gt;.*).*)(?&lt;link2&gt;\[\[(?&lt;target2&gt;[^\|\]]+\|)?(?&lt;display2&gt;[^\]]*)\]\]|\{\{(?&lt;ship_type2&gt;[\p{L}/]{2,6})\|(?&lt;target2&gt;[^\}]+)\}\})(?!\&lt;!--[acceptable|OK|keep link].*--\&gt;)</replace_>
                <with_>${link1}${inter}{{subst:#ifexist:${ship_type1} ${target1}|{{subst:trim|1=${ship_type2} ${display2}}}|${link2}&lt;!--keep link only if first link red--&gt;}}</with_>
                <ifContains_>(?&lt;=\*+ *.*[^\[\{\n]*)(\[\[|\{\{)[^\[\{\n]+\[\[[^\[\{\n]+(\[\[|\{\{)</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>4</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>(if) Unlink 2nd link in entry (simplified)**</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=\*+ *.*[^\[\{\n]*)(?&lt;link1&gt;\[\[(?&lt;target1&gt;[^\|\]]+)(\|[^\]]*)?\]\]|\{\{(?&lt;ship_type1&gt;[\p{L}/]{2,6})\|(?&lt;target1&gt;[^\}]+)\}\})(?&lt;inter&gt;[^\[\n]*)(?&lt;![Ss]ee |\&lt;!--(?!.*--\&gt;.*).*)(?&lt;link2&gt;\[\[(?&lt;target2&gt;[^\|\]]+\|)?(?&lt;display2&gt;[^\]]*)\]\]|\{\{(?&lt;ship_type2&gt;[\p{L}/]{2,6})\|(?&lt;target2&gt;[^\}]+)\}\})(?!\&lt;!--[acceptable|OK|keep link|2nd|second].*--\&gt;)</replace_>
            <with_>${link1}${inter}{{subst:#ifexist:${ship_type1} ${target1}|{{subst:trim|1=${ship_type2} ${display2}}}|${link2}&lt;!--keep link only if first link red--&gt;}}</with_>
            <ifContains_>(?&lt;=\*+ *.*[^\[\{\n]*)(\[\[|\{\{)[^\[\{\n]+(\[\[|\{\{)</ifContains_>
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>true</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>Multiline</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>(if) 30+ entries in a row**</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=\{\{[Dd]isambiguation cleanup.*)\}\}\&lt;</replace_>
                <with_>|mosdab=H}}&lt;</with_>
                <ifContains_>(?&lt;!=* *[Ss]ee also ?:? *=*\n+)(\*+.*\n){30,}</ifContains_>
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>true</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>(if) 13+ entries in a row*</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=\n+)(\n\{\{[Dd](ab|big|is(am)?(b)?(ig)?(uation)?( page)?(?&lt;tags&gt;(\|[^\|]+)*)\}\})|(?&lt;specialtag&gt;\n{\{([Hh]n|[Gg]eo)dis[\|]?[^\}]*\}\}))(?![^\n])</replace_>
            <with_>${specialtag}\n{{disambiguation cleanup${tags}|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}&lt;!--May require further organization; see [[WP:LONGDAB]]--&gt;</with_>
            <ifContains_>(?&lt;!=* *[Ss]ee also ?:? *=*\n+)(\*+.*\n){13,}</ifContains_>
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>true</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>IgnoreCase</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>but don't duplicate</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;existing&gt;\{\{(([Tt][Oo][Cc]|[Cc]ontents)( float)?[- ]?([Rr]ight|RIGHT)|[Rr]ightTOC)\}\}) *\n*\{\{TOC right\}\}</replace_>
                    <with_>${existing}</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                </Children>
                <Name>+{{tocright}} if 4+ headers*</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>^(?&lt;pre&gt;[^=]*)(?=(?&lt;!\{\{([Tt][Oo][Cc][ _-]?(float)?[ _-]?[Rr](ight|IGHT)|[Cc]ontents[ _]right|[Rr]ightTOC)\}\}\n+)=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*=[=]+.*)</replace_>
                <with_>${pre}{{TOC right}}\n</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Singleline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>No TOC after first header (NEW 22-01-05)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(?&lt;=(=[=]+.*=[=]+.*))\{\{([Tt][Oo][Cc][ _-]?(float)?[ _-]?[Rr](ight|IGHT)|[Cc]ontents[ _]right|[Rr]ightTOC)\}\}\n</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Singleline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Remove empty sections</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>(==+).*\1\s*\n(?=\1(?!=)|\{\{.*\}\}(?!\s*\n\*))</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Rm ==References==, ==Notes==, and ==External links==</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>^(=+|;) *([Rr]eference|[Nn]ote|([Ee]xternal )?[Ll]ink)[s]? *=*\n*$</replace_>
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>Multiline</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>If no other sections, remove ==Other uses==</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;!==.*==.*)(== *Other uses *==\n)</replace_>
                    <with_ />
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children>
                      <IRule xsi:type="Rule">
                        <enabled_>true</enabled_>
                        <Children />
                        <Name>Merge multiple "Other uses" sections</Name>
                        <ruletype_>OnWholePage</ruletype_>
                        <replace_>(?&lt;=== *[Oo]ther( [Uu]ses)? *==\n*)(?&lt;entries&gt;(\n\*+ *[^\n]+)+)\n*== *[Oo]ther( [Uu]ses)? *==\n*</replace_>
                        <with_>${entries}\n</with_>
                        <ifContains_ />
                        <ifNotContains_ />
                        <regex_>true</regex_>
                        <ifIsRegex_>false</ifIsRegex_>
                        <numoftimes_>1</numoftimes_>
                        <ifRegexOptions_>None</ifRegexOptions_>
                        <regexOptions_>Singleline</regexOptions_>
                      </IRule>
                      <IRule xsi:type="Rule">
                        <enabled_>true</enabled_>
                        <Children />
                        <Name>Delete "Other uses" header if first section</Name>
                        <ruletype_>OnWholePage</ruletype_>
                        <replace_>(?&lt;!.*==.*)== *[Oo]ther( [Uu]ses)? *==\n</replace_>
                        <with_ />
                        <ifContains_ />
                        <ifNotContains_ />
                        <regex_>true</regex_>
                        <ifIsRegex_>false</ifIsRegex_>
                        <numoftimes_>1</numoftimes_>
                        <ifRegexOptions_>None</ifRegexOptions_>
                        <regexOptions_>Singleline</regexOptions_>
                      </IRule>
                    </Children>
                    <Name>(if) L2 orphans to "other uses"</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;!.*==.*)\n*(?&lt;orphans&gt;(\*+ *[^\n]+\n)+)\n*(?&lt;regular_sections&gt;(\{\{.*\}\})?(\n*==+ *(?! *(\{\{subst:ucfirst:)?([Ss]ee|[Pp]eople))[^\n]+ *==+\n*(\n\*+ *[^\n]+)*)+?\n)\n*(?&lt;people_see_also&gt;(\n*== *(\{\{subst:ucfirst:)?([Ss]ee [Aa]lso|[Pp]eople[ \w\}]*) *==\n*(\n\*+ *[^\n]+)+)+\n){0,2}(?=\n*\{\{.*[Dd](AB|ab|big|is(am(b(ig(uation( page)?)?)?)?)?||))</replace_>
                    <with_>\n\n${regular_sections}\n==Other uses==\n${orphans}\n\n${people_see_also}</with_>
                    <ifContains_ />
                    <ifNotContains_>{{hndis</ifNotContains_>
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>(if) L3+ orphans to OU in section*</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;parent&gt;(?&lt;halfhead&gt;={2,})(?&lt;headname&gt;[^=\n]+)\k&lt;halfhead&gt;\n+)(?&lt;orphans&gt;(\*+.+\n)+)\n*(?&lt;subsections&gt;(\n*\k&lt;halfhead&gt;=[^=\n]+=\k&lt;halfhead&gt;\n+(^\*+.+$\n)+)+)(?=\n*(\k&lt;halfhead&gt;[^=]|\{\{))</replace_>
                    <with_>${parent}\n${subsections}\n${halfhead}=Other {{subst:#ifeq:${headname}|Places||uses in }}{{subst:lc:${headname}}}=${halfhead}\n${orphans}</with_>
                    <ifContains_>===</ifContains_>
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Multiline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>(if) Add header on hndis orphans (original)</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;!.*==.*)\n*(?&lt;orphans&gt;\*+.+)\n*(?&lt;regular_sections&gt;(\{\{.*\}\})?(\n*== *(?! *([Ss]ee|[Pp]eople))[^\n]+ *==\n*(\n\*+ *[^\n]+)+)+?\n)\n*(?&lt;people_see_also&gt;(\n*== *([Ss]ee [Aa]lso|[Pp]eople[ \w]*) *==\n*(\n\*+ *[^\n]+)+)+\n){0,2}(?=\n*\{\{.*[Dd](AB|ab|big|is(am(b(ig(uation( page)?)?)?)?)?||))</replace_>
                    <with_>\n\n==People==\n${orphans}${regular_sections}\n\n${people_see_also}</with_>
                    <ifContains_>{{hndis</ifContains_>
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>false</enabled_>
                    <Children />
                    <Name>(if) Add header on hndis orphans (simpler)</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;!==.*)(?&lt;orphans&gt;\*+.+)\n*(?===(?! *[Ss]ee| *[Pp]eople))</replace_>
                    <with_>==People==\n${orphans}</with_>
                    <ifContains_>{{hndis</ifContains_>
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Merge multiple "Other uses" sections</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;=== *[Oo]ther( [Uu]ses)? *==\n*)(?&lt;entries&gt;(\n\*+ *[^\n]+)+)\n*== *[Oo]ther( [Uu]ses)? *==\n*</replace_>
                    <with_>${entries}\n</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Delete "Other uses" header if first section</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;!.*==.*)== *[Oo]ther( [Uu]ses)? *==\n</replace_>
                    <with_ />
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Singleline</regexOptions_>
                  </IRule>
                </Children>
                <Name>MANAGE ORPHANS AND OUs (placeholder)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_ />
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>false</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children />
                <Name>Format ==See also==</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_>\n+[=\*;]{0,6}(?&lt;space&gt; ?)([Ss]ee )?[Aa]lso\W{0,6}\n+</replace_>
                <with_>\n\n==${space}See also${space}==\n</with_>
                <ifContains_ />
                <ifNotContains_ />
                <regex_>true</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
              <IRule xsi:type="Rule">
                <enabled_>true</enabled_>
                <Children>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>"Other USES (in)"</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;=[;=])Other ?(thing|item|entr(y|ies)|article|page|topic)?s?(?&lt;dab&gt; in .*)(?=[:=\n])</replace_>
                    <with_>Other uses${dab}</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>Multiline</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Standardize "Places" section name</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;===+ *)(Geography|Localities)(?= *==+)</replace_>
                    <with_>Places</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Rename culture sections</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;===+ *)(In )?([Pp]opular )?([Cc]ulture|[Ss]ociety)(?= *==+)</replace_>
                    <with_>Arts and media</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                  <IRule xsi:type="Rule">
                    <enabled_>true</enabled_>
                    <Children />
                    <Name>Avoid "print"</Name>
                    <ruletype_>OnWholePage</ruletype_>
                    <replace_>(?&lt;===+ *)Print(ed)?( media)?(?= *==+)</replace_>
                    <with_>Literature</with_>
                    <ifContains_ />
                    <ifNotContains_ />
                    <regex_>true</regex_>
                    <ifIsRegex_>false</ifIsRegex_>
                    <numoftimes_>1</numoftimes_>
                    <ifRegexOptions_>None</ifRegexOptions_>
                    <regexOptions_>None</regexOptions_>
                  </IRule>
                </Children>
                <Name>STANDARDIZE SECTION NAMES (placeholder)</Name>
                <ruletype_>OnWholePage</ruletype_>
                <replace_ />
                <with_ />
                <ifContains_ />
                <ifNotContains_ />
                <regex_>false</regex_>
                <ifIsRegex_>false</ifIsRegex_>
                <numoftimes_>1</numoftimes_>
                <ifRegexOptions_>None</ifRegexOptions_>
                <regexOptions_>None</regexOptions_>
              </IRule>
            </Children>
            <Name>If sections are present:*</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_>==</ifContains_>
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>true</enabled_>
            <Children />
            <Name>No triple newlines</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>\n{3,}</replace_>
            <with_>\n\n</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
        </Children>
        <Name>If page is a dab:</Name>
        <ruletype_>OnWholePage</ruletype_>
        <replace_ />
        <with_ />
        <ifContains_>\{\{(d(ab|big|isam)|[^\[\]\{\}\|]{1,30}d(ab|big|is(?!t))|personal name|dmbox)</ifContains_>
        <ifNotContains_ />
        <regex_>false</regex_>
        <ifIsRegex_>true</ifIsRegex_>
        <numoftimes_>1</numoftimes_>
        <ifRegexOptions_>IgnoreCase</ifRegexOptions_>
        <regexOptions_>None</regexOptions_>
      </IRule>
      <IRule xsi:type="Rule">
        <enabled_>false</enabled_>
        <Children>
          <IRule xsi:type="Rule">
            <enabled_>false</enabled_>
            <Name>Sandbox</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_ />
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>false</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>false</enabled_>
            <Children />
            <Name>(if) Only two entries (NEW)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=\n+)(\n\{\{[Dd](ab|big|is(am)?(b)?(ig)?(uation)?( page)?\}\})|(?&lt;specialtag&gt;\n{\{([Hh]n|[Gg]eo)dis[\|]?[^\}]*\}\}))(?![^\n])</replace_>
            <with_>${specialtag}\n{{disambiguation cleanup|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|mosdab=F}}&lt;!--Only two entries; if one is primary, consider redirecting and leaving a hatnote per WP:TWODABS--&gt;</with_>
            <ifContains_>(?&lt;=^[^\*]*)\*+ *.*\n\*+ *.*(?=[^\*]*$)</ifContains_>
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>true</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>false</enabled_>
            <Children />
            <Name>Don't lead with a/an/the (too broad)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;=\*+ *)(([Aa]n?|[Tt]he) )</replace_>
            <with_ />
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>false</enabled_>
            <Name>ENTRY ORDER (IN PROGRESS - DOABLE?)</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>\* *['"]*(\[\[([^\]\|]*\|)?)?(\{\{([^\}\|]*\|)?)?(?&lt;name&gt;.*)</replace_>
            <with_>{{subst:#ifeq:${name}|{{subst:PAGENAMEBASE}}||}}</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
          <IRule xsi:type="Rule">
            <enabled_>false</enabled_>
            <Children />
            <Name>Make regex readable</Name>
            <ruletype_>OnWholePage</ruletype_>
            <replace_>(?&lt;groupcode&gt;(?&lt;!\\)(\((?!\?)|\(\?(\:|\&lt;?[=!]|\&lt;[^\&gt;]*?\&gt;))|(?&lt;!\\)\||(?&lt;!\\)\)([\*\+\?]|\{[\d,]+\})?)</replace_>
            <with_>\n${groupcode}\n</with_>
            <ifContains_ />
            <ifNotContains_ />
            <regex_>true</regex_>
            <ifIsRegex_>false</ifIsRegex_>
            <numoftimes_>1</numoftimes_>
            <ifRegexOptions_>None</ifRegexOptions_>
            <regexOptions_>None</regexOptions_>
          </IRule>
        </Children>
        <Name>SANDBOX (placeholder)</Name>
        <ruletype_>OnWholePage</ruletype_>
        <replace_ />
        <with_ />
        <ifContains_ />
        <ifNotContains_ />
        <regex_>false</regex_>
        <ifIsRegex_>false</ifIsRegex_>
        <numoftimes_>1</numoftimes_>
        <ifRegexOptions_>None</ifRegexOptions_>
        <regexOptions_>None</regexOptions_>
      </IRule>
    </AdvancedReps>
    <SubstTemplates />
    <IncludeComments>false</IncludeComments>
    <ExpandRecursively>true</ExpandRecursively>
    <IgnoreUnformatted>false</IgnoreUnformatted>
  </FindAndReplace>
  <Editprefs>
    <GeneralFixes>false</GeneralFixes>
    <Tagger>false</Tagger>
    <Unicodify>false</Unicodify>
    <Recategorisation>0</Recategorisation>
    <NewCategory />
    <NewCategory2 />
    <ReImage>0</ReImage>
    <ImageFind />
    <Replace />
    <SkipIfNoCatChange>false</SkipIfNoCatChange>
    <RemoveSortKey>false</RemoveSortKey>
    <SkipIfNoImgChange>false</SkipIfNoImgChange>
    <AppendText>false</AppendText>
    <AppendTextMetaDataSort>false</AppendTextMetaDataSort>
    <Append>true</Append>
    <Text />
    <Newlines>2</Newlines>
    <AutoDelay>10</AutoDelay>
    <BotMaxEdits>0</BotMaxEdits>
    <SupressTag>false</SupressTag>
    <RegexTypoFix>false</RegexTypoFix>
  </Editprefs>
  <General>
    <AutoSaveEdit>
      <Enabled>false</Enabled>
      <SavePeriod>30</SavePeriod>
      <SaveFile />
    </AutoSaveEdit>
    <SelectedSummary>Dab cleanup+style sync per [[WP:DDD]] etc.</SelectedSummary>
    <Summaries>
      <string>Dab cleanup+style sync per [[WP:DDD]] etc.</string>
    </Summaries>
    <PasteMore>
      <string>&lt;!--second link ok--&gt;</string>
      <string />
      <string />
      <string />
      <string />
      <string />
      <string />
      <string />
      <string />
      <string />
    </PasteMore>
    <FindText>dababy</FindText>
    <FindRegex>false</FindRegex>
    <FindCaseSensitive>false</FindCaseSensitive>
    <WordWrap>true</WordWrap>
    <ToolBarEnabled>false</ToolBarEnabled>
    <BypassRedirect>true</BypassRedirect>
    <AutoSaveSettings>false</AutoSaveSettings>
    <noSectionEditSummary>false</noSectionEditSummary>
    <restrictDefaultsortAddition>true</restrictDefaultsortAddition>
    <restrictOrphanTagging>true</restrictOrphanTagging>
    <noMOSComplianceFixes>false</noMOSComplianceFixes>
    <syntaxHighlightEditBox>true</syntaxHighlightEditBox>
    <highlightAllFind>false</highlightAllFind>
    <PreParseMode>false</PreParseMode>
    <NoAutoChanges>false</NoAutoChanges>
    <OnLoadAction>0</OnLoadAction>
    <DiffInBotMode>false</DiffInBotMode>
    <Minor>true</Minor>
    <AddToWatchlist>2</AddToWatchlist>
    <TimerEnabled>false</TimerEnabled>
    <SortListAlphabetically>true</SortListAlphabetically>
    <AddIgnoredToLog>false</AddIgnoredToLog>
    <EditToolbarEnabled>true</EditToolbarEnabled>
    <filterNonMainSpace>false</filterNonMainSpace>
    <AutoFilterDuplicates>true</AutoFilterDuplicates>
    <FocusAtEndOfEditBox>false</FocusAtEndOfEditBox>
    <scrollToUnbalancedBrackets>false</scrollToUnbalancedBrackets>
    <TextBoxSize>10</TextBoxSize>
    <TextBoxFont>Courier New</TextBoxFont>
    <LowThreadPriority>false</LowThreadPriority>
    <Beep>false</Beep>
    <Flash>false</Flash>
    <Minimize>false</Minimize>
    <LockSummary>false</LockSummary>
    <SaveArticleList>true</SaveArticleList>
    <SuppressUsingAWB>false</SuppressUsingAWB>
    <AddUsingAWBToActionSummaries>false</AddUsingAWBToActionSummaries>
    <IgnoreNoBots>false</IgnoreNoBots>
    <ClearPageListOnProjectChange>false</ClearPageListOnProjectChange>
    <SortInterWikiOrder>true</SortInterWikiOrder>
    <ReplaceReferenceTags>true</ReplaceReferenceTags>
    <LoggingEnabled>true</LoggingEnabled>
    <AlertPreferences>
      <int>1</int>
      <int>2</int>
      <int>3</int>
      <int>4</int>
      <int>5</int>
      <int>6</int>
      <int>7</int>
      <int>8</int>
      <int>9</int>
      <int>10</int>
      <int>11</int>
      <int>12</int>
      <int>13</int>
      <int>14</int>
      <int>15</int>
      <int>16</int>
      <int>17</int>
      <int>18</int>
      <int>19</int>
      <int>20</int>
      <int>21</int>
      <int>22</int>
    </AlertPreferences>
  </General>
  <SkipOptions>
    <SkipNonexistent>true</SkipNonexistent>
    <Skipexistent>false</Skipexistent>
    <SkipDontCare>false</SkipDontCare>
    <SkipWhenNoChanges>true</SkipWhenNoChanges>
    <SkipSpamFilterBlocked>false</SkipSpamFilterBlocked>
    <SkipInuse>false</SkipInuse>
    <SkipWhenOnlyWhitespaceChanged>true</SkipWhenOnlyWhitespaceChanged>
    <SkipOnlyGeneralFixChanges>true</SkipOnlyGeneralFixChanges>
    <SkipOnlyMinorGeneralFixChanges>false</SkipOnlyMinorGeneralFixChanges>
    <SkipOnlyCosmetic>false</SkipOnlyCosmetic>
    <SkipOnlyCasingChanged>false</SkipOnlyCasingChanged>
    <SkipIfRedirect>false</SkipIfRedirect>
    <SkipIfNoAlerts>false</SkipIfNoAlerts>
    <SkipDoes>false</SkipDoes>
    <SkipDoesText />
    <SkipDoesRegex>false</SkipDoesRegex>
    <SkipDoesCaseSensitive>false</SkipDoesCaseSensitive>
    <SkipDoesAfterProcessing>false</SkipDoesAfterProcessing>
    <SkipDoesNot>false</SkipDoesNot>
    <SkipDoesNotText />
    <SkipDoesNotRegex>false</SkipDoesNotRegex>
    <SkipDoesNotCaseSensitive>false</SkipDoesNotCaseSensitive>
    <SkipDoesNotAfterProcessing>false</SkipDoesNotAfterProcessing>
    <SkipNoFindAndReplace>false</SkipNoFindAndReplace>
    <SkipMinorFindAndReplace>true</SkipMinorFindAndReplace>
    <SkipNoRegexTypoFix>false</SkipNoRegexTypoFix>
    <SkipNoDisambiguation>false</SkipNoDisambiguation>
    <SkipNoLinksOnPage>false</SkipNoLinksOnPage>
    <GeneralSkipList />
  </SkipOptions>
  <Module>
    <Enabled>false</Enabled>
    <Language>C# 3.5</Language>
    <Code>        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "test";
            ArticleText = "test \r\n\r\n" + ArticleText;
            return ArticleText;
        }</Code>
  </Module>
  <ExternalProgram>
    <Enabled>false</Enabled>
    <Skip>false</Skip>
    <Program />
    <Parameters />
    <PassAsFile>true</PassAsFile>
    <OutputFile />
  </ExternalProgram>
  <Disambiguation>
    <Enabled>false</Enabled>
    <Link />
    <Variants />
    <ContextChars>20</ContextChars>
  </Disambiguation>
  <Special>
    <namespaceValues />
    <remDupes>true</remDupes>
    <sortAZ>true</sortAZ>
    <filterTitlesThatContain>false</filterTitlesThatContain>
    <filterTitlesThatContainText />
    <filterTitlesThatDontContain>false</filterTitlesThatDontContain>
    <filterTitlesThatDontContainText />
    <areRegex>false</areRegex>
    <opType>0</opType>
    <remove />
  </Special>
  <Tool>
    <ListComparerUseCurrentArticleList>0</ListComparerUseCurrentArticleList>
    <ListSplitterUseCurrentArticleList>0</ListSplitterUseCurrentArticleList>
    <DatabaseScannerUseCurrentArticleList>0</DatabaseScannerUseCurrentArticleList>
  </Tool>
  <Plugin />
</AutoWikiBrowserPreferences>