From: Lyndon Samson Date: 2005-11-07T19:52:34+09:00 Subject: Re: A wiki markup class I wrote a little wiki for fun. class LykiInterpreter def LykiInterpreter.interpret(pageBody) pb=pageBody.clone regExps = [] regExps << ['(?:[^=>]|\A)([A-Z]{1}\w+[A-Z]{1}\w+)','\1'] regExps << ['^ [*](.*)$','
  • \1
  • '] regExps << ['\r','
    '] regExps << ['\[\[',''] regExps << ['\]\]',''] regExps << ['"""""(.*?)"""""','\1'] regExps << ['"""(.*?)"""','\1'] regExps << ['""(.*?)""','\1'] regExps << ['\{\{\{','
    ']
        regExps << ['}}}','
    '] regExps.each_index{|i| regExp = Regexp.new(regExps[i][0],Regexp::MULTILINE) while pb.sub!(regExp,regExps[i][1]) != nil do puts "Sub #{pb}" end } pb end end Its not really robust or efficient, but it seems to work ok. the syntax is from vqwiki, which I don't know if thats 'standard' wiki or not. Creating the array and the Regexp objects each call is not clever either :-)