Montana email regex issue, possible patch

12 views
Skip to first unread message

Chris Zubak-Skees

unread,
Nov 6, 2015, 1:20:41 PM11/6/15
to Open State Project

The Montana scraper runs emails through a regular expression that strips out the first part of many legislator email addresses. The regex truncates emails like Sen.Bradl...@mt.gov to Ham...@mt.gov and emails like james.a...@gmail.com to per...@gmail.com. As a result, several Montana emails were incorrect.


I've submitted a patch with a slightly more permissive regex: https://github.com/sunlightlabs/openstates/pull/865


This new regex is not perfect either, but based on my tests it matches every Montana legislator email address while filtering out the surrounding HTML.


Chris Zubak-Skees

News Developer

Center for Public Integrity

czuba...@publicintegrity.org

202-481-1233​​​

Reply all
Reply to author
Forward
0 new messages