Tags:
create new tag
, view all tags

Edit Syntax Regex for Wikimedia

This topic contains the syntax rules to convert TML to/from Wikimedia syntax. See EditSyntaxPlugin for format description.

Note: Do not update this topic unless you are familiar with RegularExpression syntax. Make sure to create proper pairs, so that an edit roundtrip results in the same text, including whitespace.

TWiki to Mediawiki

   * Direction: /from/to/ # optional comment
   * T2X: /(^|[\s\(])\*([^ ].*?[^ ])\*([\s\)\.\,\:\;\!\?]|$)/$1'''$2'''$3/ # bold
   * T2X: /(^|[\s\(])\_\_([^ ].*?[^ ])\_\_([\s\)\.\,\:\;\!\?]|$)/$1''<b>$2<\/b>''$3/ # italic bold
   * T2X: /(^|[\s\(])\_([^ ].*?[^ ])\_([\s\)\.\,\:\;\!\?]|$)/$1''$2''$3/ # italic
   * T2X: /(^|[\s\(])==([^ ].*?[^ ])==([\s\)\.\,\:\;\!\?]|$)/$1'''<tt>$2<\/tt>'''$3/ # monospaced bold
   * T2X: /(^|[\s\(])=([^ ].*?[^ ])=([\s\)\.\,\:\;\!\?]|$)/$1<tt>$2<\/tt>$3/ # monospaced
   * T2X: /(^|[\n\r])---\+\+\+\+\+\+([^\n\r]*)/$1======$2 ======/ # H6
   * T2X: /(^|[\n\r])---\+\+\+\+\+([^\n\r]*)/$1=====$2 =====/ # H5
   * T2X: /(^|[\n\r])---\+\+\+\+([^\n\r]*)/$1====$2 ====/ # H4
   * T2X: /(^|[\n\r])---\+\+\+([^\n\r]*)/$1===$2 ===/ # H3
   * T2X: /(^|[\n\r])---\+\+([^\n\r]*)/$1==$2 ==/ # H2
   * T2X: /(^|[\n\r])---\+([^\n\r]*)/$1=$2 =/ # H1
   * T2X: /\[\[(https?\:.*?)\]\[(.*?)\]\]/\[$1 $2\]/ # external link [[http:...][label]]
   * T2X: /\[\[([^\]]*)\]\]/\[\[$1\|$1\]\]/ # internal link [[WikiWord][WikiWord]]
   * T2X: /\[\[([^\]]*)\]\[(.*?)\]\]/\[\[$1\|$2\]\]/ # internal link [[WikiWord][label]]
   * T2X: /(^|[\n\r])[ ]{3}\* /$1\* / # level 1 bullet
   * T2X: /(^|[\n\r])[ ]{6}\* /$1\*\* / # level 2 bullet
   * T2X: /(^|[\n\r])[ ]{9}\* /$1\*\*\* / # level 3 bullet
   * T2X: /(^|[\n\r])[ ]{12}\* /$1\*\*\*\* / # level 4 bullet
   * T2X: /(^|[\n\r])[ ]{15}\* /$1\*\*\*\*\* / # level 5 bullet
   * T2X: /(^|[\n\r])[ ]{18}\* /$1\*\*\*\*\*\* / # level 6 bullet
   * T2X: /(^|[\n\r])[ ]{21}\* /$1\*\*\*\*\*\*\* / # level 7 bullet
   * T2X: /(^|[\n\r])[ ]{24}\* /$1\*\*\*\*\*\*\*\* / # level 8 bullet
   * T2X: /(^|[\n\r])[ ]{27}\* /$1\*\*\*\*\*\*\*\*\* / # level 9 bullet
   * T2X: /(^|[\n\r])[ ]{30}\* /$1\*\*\*\*\*\*\*\*\*\* / # level 10 bullet
   * T2X: /(^|[\n\r])[ ]{3}[0-9]\.? /$1\# / # level 1 bullet
   * T2X: /(^|[\n\r])[ ]{6}[0-9]\.? /$1\#\# / # level 2 bullet
   * T2X: /(^|[\n\r])[ ]{9}[0-9]\.? /$1\#\#\# / # level 3 bullet
   * T2X: /(^|[\n\r])[ ]{12}[0-9]\.? /$1\#\#\#\# / # level 4 bullet
   * T2X: /(^|[\n\r])[ ]{15}[0-9]\.? /$1\#\#\#\#\# / # level 5 bullet
   * T2X: /(^|[\n\r])[ ]{18}[0-9]\.? /$1\#\#\#\#\#\# / # level 6 bullet
   * T2X: /(^|[\n\r])[ ]{21}[0-9]\.? /$1\#\#\#\#\#\#\# / # level 7 bullet
   * T2X: /(^|[\n\r])[ ]{24}[0-9]\.? /$1\#\#\#\#\#\#\#\# / # level 8 bullet
   * T2X: /(^|[\n\r])[ ]{27}[0-9]\.? /$1\#\#\#\#\#\#\#\#\# / # level 9 bullet
   * T2X: /(^|[\n\r])[ ]{30}[0-9]\.? /$1\#\#\#\#\#\#\#\#\#\# / # level 10 bullet
   * T2X: /(^|[\n\r])[ ]{3}\$ ([^\:]*)/$1\; $2 / # $ definition: term

FIXME: Tables conversion

Mediawiki to TWiki

FIXME: Tables conversion

   * Direction: /from/to/ # optional comment
   * X2T: /(^|[\n\r])\; *([^:]*):/$1   \$ $2\:/ # ; definition : term
   * X2T: /(^|[\n\r])[\#\*]{9}\# /$1                              1. / # level 10 bullet
   * X2T: /(^|[\n\r])[\#\*]{8}\# /$1                           1. / # level 9 bullet
   * X2T: /(^|[\n\r])[\#\*]{7}\# /$1                        1. / # level 8 bullet
   * X2T: /(^|[\n\r])[\#\*]{6}\# /$1                     1. / # level 7 bullet
   * X2T: /(^|[\n\r])[\#\*]{5}\# /$1                  1. / # level 6 bullet
   * X2T: /(^|[\n\r])[\#\*]{4}\# /$1               1. / # level 5 bullet
   * X2T: /(^|[\n\r])[\#\*]{3}\# /$1            1. / # level 4 bullet
   * X2T: /(^|[\n\r])[\#\*]{2}\# /$1         1. / # level 3 bullet
   * X2T: /(^|[\n\r])[\#\*]{1}\# /$1      1. / # level 2 bullet
   * X2T: /(^|[\n\r])\# /$1   1. / # level 1 bullet
   * X2T: /(^|[\n\r])[\#\*]{9}\* /$1                              \* / # level 10 bullet
   * X2T: /(^|[\n\r])[\#\*]{8}\* /$1                           \* / # level 9 bullet
   * X2T: /(^|[\n\r])[\#\*]{7}\* /$1                        \* / # level 8 bullet
   * X2T: /(^|[\n\r])[\#\*]{6}\* /$1                     \* / # level 7 bullet
   * X2T: /(^|[\n\r])[\#\*]{5}\* /$1                  \* / # level 6 bullet
   * X2T: /(^|[\n\r])[\#\*]{4}\* /$1               \* / # level 5 bullet
   * X2T: /(^|[\n\r])[\#\*]{3}\* /$1            \* / # level 4 bullet
   * X2T: /(^|[\n\r])[\#\*]{2}\* /$1         \* / # level 3 bullet
   * X2T: /(^|[\n\r])[\#\*]{1}\* /$1      \* / # level 2 bullet
   * X2T: /(^|[\n\r])\* /$1   \* / # level 1 bullet
   * X2T: /\[\[Image\:([^\]]*)\]\]/\%ATTACHURL\%\/$1/ # [[Image:file.png]]
   * X2T: /\[\[([^\|]*)\|(\1)\]\]/\[\[$1\]\]/ # internal link [[WikiWord|WikiWord]]
   * X2T: /\[\[([^\|]*)\|([^\]]*?)\]\]/\[\[$1\]\[$2\]\]/ # internal link [[WikiWord|label]]
   * X2T: /(?=[^\]]|^)\[(https?\:.*?) (.*?)\](?=[^\]]|$)/\[\[$1\]\[$2\]\]/ # external link [http:... label]
   * X2T: /(^|[\n\r])======(.*?) ?======(?=[\n\r]|$)/$1---\+\+\+\+\+\+$2/ # H6
   * X2T: /(^|[\n\r])=====(.*?) ?=====(?=[\n\r]|$)/$1---\+\+\+\+\+$2/ # H5
   * X2T: /(^|[\n\r])====(.*?) ?====(?=[\n\r]|$)/$1---\+\+\+\+$2/ # H4
   * X2T: /(^|[\n\r])===(.*?) ?===(?=[\n\r]|$)/$1---\+\+\+$2/ # H3
   * X2T: /(^|[\n\r])==(.*?) ?==(?=[\n\r]|$)/$1---\+\+$2/ # H2
   * X2T: /(^|[\n\r])=(.*?) ?=(?=[\n\r]|$)/$1---\+$2/ # H1
   * X2T: /(^|[\s\(])<tt>([^ ].*?[^ ])<\/tt>([\s\)\.\,\:\;\!\?]|$)/$1=$2=$3/ # monospaced
   * X2T: /(^|[\s\(])'''<tt>([^ ].*?[^ ])<\/tt>'''([\s\)\.\,\:\;\!\?]|$)/$1==$2==$3/ # monospaced bold
   * X2T: /(^|[\s\(])'''([^ ].*?[^ ])'''([\s\)\.\,\:\;\!\?]|$)/$1\*$2\*$3/ # bold
   * X2T: /(^|[\s\(])''<b>([^ ].*?[^ ])<\/b>''([\s\)\.\,\:\;\!\?]|$)/$1\_\_$2\_\_$3/ # italic bold
   * X2T: /(^|[\s\(])''([^ ].*?[^ ])''([\s\)\.\,\:\;\!\?]|$)/$1\_$2\_$3/ # italic

See also:

Access control:

-- TWiki:Main.PeterThoeny - 09 Jul 2006

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2006-12-13 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.