1
所以我有这个简单的文字:获得从文本链接
To activate your account click the link below:
https://tbeyfee-gkg9834636j-gergity3yu3hgge-drgengo9476y3ltjne
If the above URL does not work try copying and pasting it into your browser. If you continue to have problem please feel free to contact us.
If you have any questions, please do not hesitate to contact your account manager directly or email us at [email protected] and we'll get right back to you.
Thanks again for choosing logger.
Kind regards,
The Logger Team
会是什么简单的方法来抓住这个https
链接?
这是我尝试:
val str = "" // This is my string.
val pattern = new Regex("^https.*$")
println(pattern.findAllIn(str))
这是1:'^ https。* $'' – ritesht93
你是否坚持使用Scala代码或正则表达式?有关正则表达式,请参阅http://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url。 –
请参阅我的更新。 –