KILabel
KILabel copied to clipboard
regex to not detect hashtag after a character not space
I am trying to scan for hashtags from NSStrings in Objective-C and I am using regex. I made a test status on Facebook / Instagram to see what are the valid hashtags as it is where
Now KILabel.m (getRangeForHashTags line : 437)
regex = [[NSRegularExpression alloc] initWithPattern:@"(?<!\w)#([\w_]+)?" options:0 error:&error]; My Solution (It's works fine. when not space)
regex = [[NSRegularExpression alloc] initWithPattern:@"((#)([\w_]+)?)" options:0 error:&error]; Thanks.