We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
Here's a possible fix:
func addSpaceAfterLinks(_ content: String) -> String { let pattern = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)(?![\n\s])/ let modifiedContent = content.replacing(pattern, maxReplacements: 10) { match in content[match.range] + " " } return modifiedContent }
But the regex still needs fix. It cannot handle contents like
http://www.whxinan.net/dongman/mingzhentankenanwanshengjiedexinniang/2-1.html 这个网站有人在电影院拍的,勉强能看吧
or
https://www.wjx.cn/vm/hxjo6de.aspx# 关于疫情下志愿服务开展状况的问卷,有50%概率获得红包,roll5个带r的uu请奶茶,请大家帮忙填填😭😭😭
Sorry, something went wrong.
What is the current regex? A simple fix would be to exclude unicode characters.
No regex currently exists.
singularity-s0
No branches or pull requests
The text was updated successfully, but these errors were encountered: