Changeset 3383
- Timestamp:
- 11/11/06 23:52:19 (2 years ago)
- Files:
-
- trunk/Additions/NSAttributedStringMoreAdditions.m (modified) (2 diffs)
- trunk/Frameworks/frameworks.tar.gz (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Additions/NSAttributedStringMoreAdditions.m
r3072 r3383 309 309 - (void) makeLinkAttributesAutomatically { 310 310 // catch well-formed urls like "http://www.apple.com", "www.apple.com" or "irc://irc.javelin.cc" 311 AGRegex *regex = [AGRegex regexWithPattern:@"(?:[a-zA-Z][a-zA-Z0-9+.-]*: //|www\\.)(?:[\\w:-]+@)?(?:\\d{1,3}(?:\\.\\d{1,3}){3}|(?:[\\p{L}\\p{N}-]+\\.)+\\w{2,4}\\.?|localhost)(?:\\:\\d+)?(?:[/?][\\p{L}\\p{N}$\\-_.+!*',=:\\|/\\\\()%@&;#?~]*)*(?=[>}\\]):;,.!?'\"]|\\b)" options:AGRegexCaseInsensitive];311 AGRegex *regex = [AGRegex regexWithPattern:@"(?:[a-zA-Z][a-zA-Z0-9+.-]*:(?://)?|www\\.)[\\p{L}\\p{N}$\\-_+*'\"=:\\|/\\\\()%@&#~,;.!?]+[\\p{L}\\p{N}$\\-_+*=:\\|/\\\\()%@&#~]" options:AGRegexCaseInsensitive]; 312 312 NSArray *matches = [regex findAllInString:[self string]]; 313 313 NSEnumerator *enumerator = [matches objectEnumerator]; … … 321 321 322 322 // catch well-formed email addresses like "timothy@hatcher.name" or "timothy@javelin.cc" 323 regex = [AGRegex regexWithPattern:@"[\\ w.+-]+@(?:[\\p{L}-]+\\.)+[\\w]{2,}" options:AGRegexCaseInsensitive];323 regex = [AGRegex regexWithPattern:@"[\\p{L}\\p{N}.+-]+@(?:[\\p{L}-]+\\.)+[\\w]{2,}" options:AGRegexCaseInsensitive]; 324 324 matches = [regex findAllInString:[self string]]; 325 325 enumerator = [matches objectEnumerator];
