Line 81: |
Line 81: |
| |+ align="bottom" | Table caption. | | |+ align="bottom" | Table caption. |
| </pre> | | </pre> |
| + | |
| + | ===Regex patterns=== |
| + | Page number blocks |
| + | <nowiki>re.sub("<blockquote>.*Page [0-9]*-*</blockquote>",r"",str)</nowiki> |
| + | |
| + | H2 headings, indiscriminate |
| + | <nowiki>re.sub("<p><strong>(.*)</strong></p>",r"==\1==",str)</nowiki> |
| + | |
| + | Possible new articles, H1 headings |
| + | <nowiki>re.sub("<p><strong>([A-Z ]*)</strong></p>",r"==\1==",str)</nowiki> |
| + | |
| + | Finds reference citations |
| + | <nowiki>re.sub("\(([a-zA-Z ]*[,] (in press)*[0-9]{4})\)",r"<ref>\1</ref>",s)</nowiki> |
| + | |
| + | Almost makes references key in list of refs (doesn't handle accented characters) |
| + | <nowiki>re.sub(r"<p>([-a-zA-Z]*).*([0-9]{4}).*</p>",r"\1\2",r)</nowiki> |
| + | |
| + | Finds figures |
| + | <nowiki>re.sub(r"<p><strong>Fig\. [0-9]*\. (.*)</strong></p>",r"[[File:AUTHOR_SOMETHING.png|thumb|\1]]",s)</nowiki> |
| + | |
| + | Finds tables; may want to put image of table here too, and build empty table |
| + | <nowiki>re.sub(r"<p><strong>(Table [0-9]*)\. (.*)</strong></p>",r"<!-- \1 -- \2 --> ",s)</nowiki> |
| | | |
| ===Methods for converting=== | | ===Methods for converting=== |