| 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

alnum, alnum, alpha, cellpadding='3, filterlock, filterreplace, filterreplace, join, lock, lock, punct, replace, replace, space

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/>! # ordered/unordered list FilterReplace wiki.ListRow !(^\t+(\*|[1234567890]+)\.?\s*(.+)(\n|\z))+!\n&~0! # monospace Replace !(^ (.+))(\n (.+))*!<pre>$0! Replace !<pre> !
Replace !\n !\n!

# 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):([^\s\<\>\[\]\"'\(\)\?])*[^\s\<\>\[\]\"'\(\)\?\,\.](\.gif|\.jp[eg]{1,2}|\.png)([\?][^\s\<\>\[\]\"'\(\)\?]*[^\s\<\>\[\]\"'\(\)\?\,\.])?(?-i)!! Lock !(?i)(http|https|ftp|file|mailto)(?-i):([^\s\<\>\[\]\"'\(\)\?])*[^\s\<\>\[\]\"'\(\)\?\,\.]([\?][^\s\<\>\[\]\"'\(\)\?]*[^\s\<\>\[\]\"'\(\)\?\,\.])?!&0! Lock !(?:(?i)mailto:(?-i))((\p{Alnum}+(\.|\_|\-)?)*\p{Alnum}@(((\p{Alnum}+(\.|\_|\-)?)*\p{Alpha})|((([0-1]?\d{1,2}\.)|(2[0-4]\d\.)|(25[0-5]\.)){3}(([0-1]?\d{1,2}\.)|(2[0-4]\d\.)|(25[0-5])))))!<a href='&0'>&1! # embedded ISBN FilterLock wiki.CompressISBN !(?:\[\s?)?(?:ISBN:?\s?)((?:\d[ -]?){9}(?:[\dXx]))(?:\s?\])?!<a href=''>ISBN &1! # remote wiki link FilterReplace wiki.RemoteWikiLink !(\p{Alpha}+):([^\s\n\Z}]+)!&~1{&1}{&2}! Lock !\nremote\{(.*)\}\{(.*)\}\{(.*)\}!<a href='&1&3'>&2:&3! Lock !\nunknown\{(.*)\}\{(.*)\}\{(.*)\}!&2:&3! # internal page link FilterReplace wiki.LocalWikiLink /(^|\p{Punct}|\p{Space})((\p{Lu}\p{Ll}+){2,})(\z|\n|\p{Punct}|\p{Space})/&1&~2&4/ Lock !\?\?\n(?:view|edit)\{(.*),(.*)\}\n!<a href='diff?&2'>changes! Lock !\nview\{(.*),(.*)\}\n!<a href='view?&2'>&1! Lock !\nedit\{(.*),(.*)\}\n!&1<a href='edit?&2'>?! # 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

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.