| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
cp syntax.txt syntax.html |
| 4 |
sam -d syntax.html <<'!' |
| 5 |
,s/\&/\&/g |
| 6 |
,s/</\</g |
| 7 |
,s/>/\>/g |
| 8 |
,s!== (([^()]|\([^()]*\))*)!≡ <code>\1</code>!g |
| 9 |
,s!«!<code>!g |
| 10 |
,s!»!</code>!g |
| 11 |
,s! vim$! <font size=-2>VIM</font>!g |
| 12 |
,s! pcre$! <font size=-2>PCRE</font>!g |
| 13 |
,s! perl$! <font size=-2>PERL</font>!g |
| 14 |
,x g/NOT SUPPORTED/ s!^[^ ]+!<font color=#808080>&</font>! |
| 15 |
,s!NOT SUPPORTED!!g |
| 16 |
,s!(^[^ ]+) (.*)\n!<tr><td><code>\1</code></td><td>\2</td></tr>\n!g |
| 17 |
,s!.*:$!<b>&</b>!g |
| 18 |
,s!^$!<tr><td></td></tr>!g |
| 19 |
,x v/<tr>/ s!.*!<tr><td colspan=2>&</td></tr>! |
| 20 |
1,2c |
| 21 |
<html> |
| 22 |
<!-- AUTOMATICALLY GENERATED by mksyntaxhtml --> |
| 23 |
<head> |
| 24 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 25 |
<title>RE2 regular expression syntax reference</title> |
| 26 |
</head> |
| 27 |
<body> |
| 28 |
<h1>RE2 regular expression syntax reference</h1> |
| 29 |
|
| 30 |
<table border=0 cellpadding=2 cellspacing=2> |
| 31 |
<tr><td colspan=2>This page lists the regular expression syntax accepted by RE2.</td></tr> |
| 32 |
<tr><td colspan=2>It also lists syntax accepted by PCRE, PERL, and VIM.</td></tr> |
| 33 |
<tr><td colspan=2>Grayed out expressions are not supported by RE2.</td></tr> |
| 34 |
. |
| 35 |
$a |
| 36 |
</table> |
| 37 |
</body> |
| 38 |
</html> |
| 39 |
. |
| 40 |
w |
| 41 |
q |
| 42 |
! |