[英]Need help modifing regex
I am currently using the regex given below to add hrefs to my urls. 我目前正在使用下面给出的正则表达式将href添加到我的网址中。 But recently I got a bug because one of the urls had a full stop after it and the regex added the dot into the link.
但是最近我遇到了一个错误,因为其中一个网址在它之后停了下来,并且正则表达式将点添加到了链接中。
(?:https?|ftps?)://[\\w/%.-]+", "<a href='$0'target='_blank'> $0</a>
So,can it be modfied so that it takes only one dot? 那么,可以修改它使其仅占用一个点吗? I'm using Java.
我正在使用Java。
我像这样编辑了我的,它就起作用了。“(?:https?| ftps?):// [\\ w。] + / [\\ w] +”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.