fork(1) download
  1. import scala.util.matching.Regex
  2. object Main extends App {
  3. var str = "To activate your account click the link below:\nhttps://tbeyfee-gkg9834636j-gergity3yu3hgge-drgengo9476y3ltjne\nIf 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.\nIf you have any questions, please do not hesitate to contact your account manager directly or email us at info@logger.com and we'll get right back to you.\nThanks again for choosing logger.\nKind regards,\nThe Logger Team"
  4. val pattern = new Regex("(?m)^https://\\S+$")
  5. val res = pattern.findFirstIn(str)
  6. println(res)
  7. }
Success #stdin #stdout 0.35s 322496KB
stdin
Standard input is empty
stdout
Some(https://tbeyfee-gkg9834636j-gergity3yu3hgge-drgengo9476y3ltjne)