Changeset 3445

Show
Ignore:
Timestamp:
12/08/06 20:44:43 (2 years ago)
Author:
timothy
Message:

Further limiting URL linking making the '://' required for a valid URL. There are too many cases where text that looks like non-hierarchal URLs is really just text with colons. #913

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Additions/NSAttributedStringMoreAdditions.m

    r3418 r3445  
    309309- (void) makeLinkAttributesAutomatically { 
    310310        // 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+.-]{2,}:(?!:)(?:(?!\\p{N}{,6}\\b)|(?://)?)|www\\.)[\\p{L}\\p{N}$\\-_+*'\"=\\|/\\\\(){}[\\]%@&#~,:;.!?]{4,}[\\p{L}\\p{N}$\\-_+*=\\|/\\\\({%@&#~]" options:AGRegexCaseInsensitive]; 
     311        AGRegex *regex = [AGRegex regexWithPattern:@"(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}://|www\\.)[\\p{L}\\p{N}$\\-_+*'\"=\\|/\\\\(){}[\\]%@&#~,:;.!?]{4,}[\\p{L}\\p{N}$\\-_+*=\\|/\\\\({%@&#~]" options:AGRegexCaseInsensitive]; 
    312312        NSArray *matches = [regex findAllInString:[self string]]; 
    313313        NSEnumerator *enumerator = [matches objectEnumerator];