Krelborn / KILabel

A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable.
MIT License
470 stars 133 forks source link

regex to ignore @ and # if there is no character after these special symbols #41

Open vbansal13 opened 8 years ago

vbansal13 commented 8 years ago

regex = [[NSRegularExpression alloc] initWithPattern:@"(?<!\w)@([\w_]+)?" options:0 error:&error];

should be changed to

regex = [[NSRegularExpression alloc] initWithPattern:@"(?<!\w)@([\w_]+)+" options:0 error:&error];

for detecting 1 or more characters afters @ instead of 0 or more characters.

The same should be done for getRangesForHashtags()

nyeu commented 8 years ago

thanks @vbansal13 !! Works like a charm and it was exactly what I needed