Download - The Bastards Book of Regular Expressions
Download - The Bastards Book of Regular Expressions
Download - The Bastards Book of Regular Expressions
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CONTENTSData Cleaning with the Stars 129Normalized alphabetical titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Make your own delimiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130Finding needles in haystacks (TODO) 133Shakespeare’s longest word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Changing phone format (TODO) 136Telephone game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Ordering names and dates (TODO) 145Year, months, days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Preparing for a spreadsheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Dating, Associated Press Style (TODO) 146Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146<strong>The</strong> AP Date format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146Real-world considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150<strong>The</strong> limits <strong>of</strong> regex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Sorting a police blotter 153Sloppy copy-and-paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154Start loose and simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157Converting XML to tab-delimited data 158<strong>The</strong> payments XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158<strong>The</strong> pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160Add more delimitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Cleaning up Micros<strong>of</strong>t Word HTML (TODO) 162