Changeset 3392

Show
Ignore:
Timestamp:
11/13/06 11:18:42 (2 years ago)
Author:
timothy
Message:

Fix URL link detection some more, don't include the trailing ')' in '(www.apple.com)'.

Files:

Legend:

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

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