mksyntaxwiki 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. cp syntax.txt syntax.wiki
  3. sam -d syntax.wiki <<'!'
  4. ,s!`!`````!g
  5. ,s!== (([^()]|\([^()]*\))*)!≡ `\1`!g
  6. ,s!«!`!g
  7. ,s!»!`!g
  8. ,s! vim$! <font size="1">VIM</font>!g
  9. ,s! pcre$! <font size="1">PCRE</font>!g
  10. ,s! perl$! <font size="1">PERL</font>!g
  11. ,s!(^[^ ]+) (.*)\n!`\1` \2\n!g
  12. ,x g/NOT SUPPORTED/ s!^[^ ]+!<font color="#808080">&</font>!
  13. ,s!NOT SUPPORTED!<font size="1">(&)</font>!g
  14. ,s!(^[^ ]+) (.*)\n!<tr><td>\1</td><td>\2</td></tr>\n!g
  15. ,s!.*:$!<b>&</b>!g
  16. ,s!^$!<tr><td></td></tr>!g
  17. ,x v/<tr>/ s!.*!<tr><td colspan="2">&</td></tr>!
  18. 1,2c
  19. #summary I define UNIX as “30 definitions of regular expressions living under one roof.” —Don Knuth
  20. <wiki:comment>
  21. GENERATED BY mksyntaxwiki. DO NOT EDIT
  22. </wiki:comment>
  23. <table border="0" cellpadding="2" cellspacing="2">
  24. <tr><td colspan="2">This page lists the regular expression syntax accepted by RE2.</td></tr>
  25. <tr><td colspan="2">It also lists syntax accepted by PCRE, PERL, and VIM.</td></tr>
  26. <tr><td colspan="2">Grayed out expressions are not supported by RE2.</td></tr>
  27. .
  28. $a
  29. </table>
  30. .
  31. w
  32. q
  33. !