On Mar 3, 2012, at 5:42 PM, Per Bull Holmen wrote: > How about just work with your regular expressions > and try to narrow down the patterns it will accept?
I’d much rather people used a system library, or at least searched around to find a really good and well-tested regexp that other apps have used. It’s annoying when an app can’t highlight a URL properly, especially on iOS where it’s really awkward to open a URL that isn’t auto-highlighted. I’ve seen URL highlighters break in lots of ways, like — not recognizing URLs that don’t contain the scheme, like “www.apple.com” — only recognizing a short hardcoded list of schemes. This annoyed me when I worked at Apple, where “rdar:” URLs are very often used to refer to bug IDs. — breaking off in the middle of the URL if it got split up with a newline by a mail transfer agent — breaking off a URL at a character that’s valid but someone though wasn’t, like a + or * — not ignoring a trailing comma or period at the end of a URL used in a sentence Et cetera. Yes, I once worked on an app that had its own URL highlighter (iChat), and we got a surprising number of bug reports about it for reasons like the above. For something conceptually simple, it was a pain to maintain. Don’t write your own if you can avoid it. —Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com