There is only one valid URL per message. This is a situational constraint (also written in the spec). I know that because these are 'Emails-to-self' that contain at max two URLs (one in the plain text part, one in the HTML part if it exists)
Maybe it's a bit difficult to read but the regex is transforming the subject into a suitable filename, escaping problematic characters.
I tried to be sensible about the error checking and assumed the modules do error handling for their part, outside of that there's hardly any code in its own right.
Now that I think of it though, input should have been checked. That was a mistake.
What else do you think needs explicit error handling?
In reply to Re^2: Please critique this script -- Read emails and write URLs into bookmarks
by Anonymous Monk
in thread Please critique this script -- Read emails and write URLs into bookmarks
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |