Atributika icon indicating copy to clipboard operation
Atributika copied to clipboard

onClick detection custom regex

Open sahibhussain opened this issue 4 years ago • 1 comments

i want to get the string with the custom regex how i can i achieve it?

commentTextLabel.attributedText = text .style(regex: "@[A-Za-z0-9_-]", style: mentions) .styleAll(normal)

onClick detection gives me the regex not the actual string case .regex(<#T##String#>)

sahibhussain avatar Jun 29 '21 11:06 sahibhussain

You can preprocess your text before put style to it, eg replace @[A-Za-z0-9_-] to <a href=$1>$1</a> and use linkdetector

matopeto avatar Aug 04 '21 08:08 matopeto