From Wikipedia, the free encyclopedia
| This is a repository of settings and scripts which perform specific tasks using the AutoWikiBrowser. |
[edit] Scripts & Settings
[edit] Sample regular expressions
- Replace double spacing with single spacing
Match: \. [ ]+([A-Za-z\[])
Replace: . $1
Note: This may replace double-spaces inside <pre> tags, so you need to be careful.
[edit] XHTML compliance
- <br> and <hr> to <br /> and <hr />
Match: <[/]?(br|hr)([^{/}<>]*?)>
Replace: <$1$2 />
- HTML Attribute quoting
Match: (<\w+)\s*(\w+) *= *(['"]([^"']*?)['"]|([#-9A-Za-z]+))([^{}<>]*>)
Replace: $1 $2="$4$5"$6
[edit] Conditions
- Between X and Y bytes of wikitext
- Single line conditional regex:
^.{0,900}$ where 0 is the mininum and 900 is the maximum
- Curd word count
- Single line conditional regex:
^\W*(\w+\W+){13,29}\w*$ where 13 is the mininum and 29 is the maximum
[edit] External link simplification
- External Wikipedia link to internal
Match: \[http://en.wikipedia.org/wiki/:*([^][<>"\s]+) ([^]]+)\]
Replace: [[:$1|$2]]
Notes: The colon is needed to prevent category or images from being embedded. Also, not recommended since it can mess with references.
- Wikimedia Foundation external links to interwikis
Match: \[http://([a-z0-9\-]{3})\.(?:(wikt)ionary|wiki(n)ews|wiki(b)ooks|wiki(q)uote|wiki(s)ource|wiki(v)ersity)\.(?:com|net|org)/wiki/([^][<>{|}\s"]*) +([^\n\]]+)\]
Replace: [[$2$3$4$5$6$7:$1:$8|$9]]
Match: \[http://(?:(m)eta|(commons)|(incubator)|(quality))\.wikimedia\.(?:com|net|org)/wiki/([^][<>{|}\s"]*) +([^\n\]]+)\]
Replace: [[$1$2$3$4:$5|$6]]
- Wikia wikis external links to interwikis
Match: \[http://([a-z0-9\-]+)\.wikia\.(?:com|net|org)/wiki/([^][<>{|}\s"]+) +([^\n\]]+)\]
Replace: [[wikia:$1:$2|$3]]
- External Toolserver to interwiki link
Match: \[http://(?:www\.)?(toolserver\.org|tools\.wikimedia\.org|tools\.wikimedia\.de)/([^][<>\s";?]*)\?? ([^]\n]+)\]
Replace: [[tools:$2|$3]]
- Use newer {{fullurl}} magic word
Match: [{{SERVER}}{{localurl:
Replace: [{{fullurl: