| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Friki example source code file (wiki.transform)

This example Friki source code file (wiki.transform) is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Friki tags/keywords

alpha, alpha, border, cellpadding='3, cellspacing='0, filterlock, filterlock, forcereplace, gg, join, lock, lock, replace, replace

The Friki wiki.transform source code

# harmonise line-endings
Replace !(\n\r)|(\r\n)|(\r)!\n!

# escape rogue HTML
Replace !<!<!
Replace !>!>!

# "six-ticks" - override pattern recognition
Replace !''''''!<b>!

# "hands-off" block
Lock !\[\n((.|\n)*?)\n\]!<pre>&1
! # tabs, emphasis and rulers Replace ! !\t! Replace !\n\s*\n!\n<p/>\n! Replace !'{5}(.+?)'{5}!<i>$1! Replace !'{3}(.+?)'{3}!<b>$1! Replace !'{2}(.+?)'{2}!<i>$1! Replace !(^|\n)-{4,}!\n<hr/>! # monospace Replace !((^|\n) (.+))+!<pre>$0! Replace !<pre> !
Replace !\n !\n!

# ordered/unordered list
FilterReplace wiki.ListRow !((^|\n)\t+(\*|[1234567890]+)\.?\s*(.*))+!&~0!

# def list
Replace !(((?:^|\n)\t+)(?:\s*)(.*)(?:\s*):(?:\s*)(.*))+!<dl>\n$0\n!
Replace !((?:^|\n)\t+)(?:\s*)(.*)(?:\s*):(?:\s*)(.*)!$1<dt>$2
! # embedded URLs Lock !(?i)(http|https|ftp|file)(?-i):([^\s\<\>\[\]\"'\(\)\?])*[^\s\<\>\[\]\"'\(\)\?\,\.](\.[Gg][Ii][Ff]|\.[Jj][Pp][EeGg]{1,2}|\.[Pp][Nn][Gg])([\?][^\s\<\>\[\]\"'\(\)\?]*[^\s\<\>\[\]\"'\(\)\?\,\.])?!! Lock !(?i)(http|https|file|ftp|mailto)(?-i):([^\s\<\>\[\]\"'\(\)\?])*[^\s\<\>\[\]\"'\(\)\?\,\.]([\?][^\s\<\>\[\]\"'\(\)\?]*[^\s\<\>\[\]\"'\(\)\?\,\.])?!&0! # embedded ISBN FilterLock wiki.CompressISBN !(?:\[\s?)?(?:ISBN:?\s?)((?:\d[ -]?){9}(?:[\dXx]))(?:\s?\])?!<a href=''>ISBN &1! # remote wiki link FilterLock wiki.RemoteWikiLink !(\p{Alpha}+)(:\p{Alpha}+)!&~1&0! ForceReplace !^remote\{(.*)\}(\p{Alpha}+):(\p{Alpha}+)!<a href='$1$3'>$2:$3! # internal page link FilterLock wiki.LocalWikiLink !(^|\b)((\p{Lu}\p{Ll}+){2,})(^|\b)!&~1! ForceReplace !^view\{(.*)\}!<a href='view?$1'>$1! ForceReplace !^edit\{(.*)\}!$1<a href='edit?$1'>?! # a "hook" for extra user-defined processing without mucking up this file Include wiki-extra.txt # merge locked and unlocked regions so they can be placed in table cells Join # table (follows the Join, to allow "hands off" blocks in table cells FilterLock wiki.TableRow !(?<=(^|\n))\|(([^<]||.*?||
)*?\|[ \t]*)+(?=($|\n))!&~0\n
! # FilterLock wiki.TableRow !(((^|\n)\|((.*?|(<pre>(.|\n)*?
))\|[ \t]*)))+(?=$|\n)!&~0\n

Other Friki examples (source code examples)

Here is a short list of links related to this Friki wiki.transform source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.