You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
3.9 KiB

  1. <?php
  2. // Project: Web Reference Database (refbase) <http://www.refbase.net>
  3. // Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
  4. // original author(s).
  5. //
  6. // This code is distributed in the hope that it will be useful,
  7. // but WITHOUT ANY WARRANTY. Please see the GNU General Public
  8. // License for more details.
  9. //
  10. // File: ./includes/transtab_refbase_ascii.inc.php
  11. // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/includes/transtab_refbase_ascii.inc.php $
  12. // Author(s): Matthias Steffens <mailto:refbase@extracts.de>
  13. //
  14. // Created: 28-May-06, 18:24
  15. // Modified: $Date: 2008-10-30 17:19:48 +0000 (Thu, 30 Oct 2008) $
  16. // $Author: msteffens $
  17. // $Revision: 1288 $
  18. // Search & replace patterns for conversion from refbase markup to plain text. Removes refbase fontshape markup (italic, bold, underline)
  19. // as well as markup for super- and subscript or greek letters from the text. Adopt to your needs if necessary.
  20. // Search & replace patterns must be specified as perl-style regular expression and search patterns must include the leading & trailing slashes.
  21. global $patternModifiers; // defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
  22. $transtab_refbase_ascii = array(
  23. "/__(?!_)(.+?)__/" => "\\1", // the pattern for underline (__...__) must come before the one for italic (_..._)
  24. "/_(.+?)_/" => "\\1",
  25. "/\\*\\*(.+?)\\*\\*/" => "\\1",
  26. "/\\[super:(.+?)\\]/i" => "\\1",
  27. "/\\[sub:(.+?)\\]/i" => "\\1",
  28. "/\\[permil\\]/" => "per mille",
  29. "/\\[infinity\\]/" => "infinity",
  30. "/\\[alpha\\]/" => "alpha",
  31. "/\\[beta\\]/" => "beta",
  32. "/\\[gamma\\]/" => "gamma",
  33. "/\\[delta\\]/" => "delta",
  34. "/\\[epsilon\\]/" => "epsilon",
  35. "/\\[zeta\\]/" => "zeta",
  36. "/\\[eta\\]/" => "eta",
  37. "/\\[theta\\]/" => "theta",
  38. "/\\[iota\\]/" => "iota",
  39. "/\\[kappa\\]/" => "kappa",
  40. "/\\[lambda\\]/" => "lambda",
  41. "/\\[mu\\]/" => "mu",
  42. "/\\[nu\\]/" => "nu",
  43. "/\\[xi\\]/" => "xi",
  44. "/\\[omicron\\]/" => "omicron",
  45. "/\\[pi\\]/" => "pi",
  46. "/\\[rho\\]/" => "rho",
  47. "/\\[sigmaf\\]/" => "sigmaf",
  48. "/\\[sigma\\]/" => "sigma",
  49. "/\\[tau\\]/" => "tau",
  50. "/\\[upsilon\\]/" => "upsilon",
  51. "/\\[phi\\]/" => "phi",
  52. "/\\[chi\\]/" => "chi",
  53. "/\\[psi\\]/" => "psi",
  54. "/\\[omega\\]/" => "omega",
  55. "/\\[Alpha\\]/" => "Alpha",
  56. "/\\[Beta\\]/" => "Beta",
  57. "/\\[Gamma\\]/" => "Gamma",
  58. "/\\[Delta\\]/" => "Delta",
  59. "/\\[Epsilon\\]/" => "Epsilon",
  60. "/\\[Zeta\\]/" => "Zeta",
  61. "/\\[Eta\\]/" => "Eta",
  62. "/\\[Theta\\]/" => "Theta",
  63. "/\\[Iota\\]/" => "Iota",
  64. "/\\[Kappa\\]/" => "Kappa",
  65. "/\\[Lambda\\]/" => "Lambda",
  66. "/\\[Mu\\]/" => "Mu",
  67. "/\\[Nu\\]/" => "Nu",
  68. "/\\[Xi\\]/" => "Xi",
  69. "/\\[Omicron\\]/" => "Omicron",
  70. "/\\[Pi\\]/" => "Pi",
  71. "/\\[Rho\\]/" => "Rho",
  72. "/\\[Sigma\\]/" => "Sigma",
  73. "/\\[Tau\\]/" => "Tau",
  74. "/\\[Upsilon\\]/" => "Upsilon",
  75. "/\\[Phi\\]/" => "Phi",
  76. "/\\[Chi\\]/" => "Chi",
  77. "/\\[Psi\\]/" => "Psi",
  78. "/\\[Omega\\]/" => "Omega",
  79. // "/�/$patternModifiers" => "-"
  80. // Note that for UTF-8 based systems, '$patternModifiers' contains the "u" (PCRE_UTF8) pattern modifier which should cause PHP/PCRE
  81. // to treat pattern strings as UTF-8 (otherwise this conversion pattern would garble UTF-8 characters such as "�"). However, the
  82. // "�" character still seems to cause PREG compilation errors on some UTF8-based systems, which is why the line has been commented
  83. // out (it should work fine for a latin1-based system, though).
  84. );
  85. ?>