Skip to content

Instantly share code, notes, and snippets.

@NikitaMelnikov
Created August 26, 2016 12:10
Show Gist options
  • Save NikitaMelnikov/ab21ca43a54532295de509f9bf71921c to your computer and use it in GitHub Desktop.
Save NikitaMelnikov/ab21ca43a54532295de509f9bf71921c to your computer and use it in GitHub Desktop.
case class Commit(id: String, title: String)
val taskNamePattern = "[a-zA-Z]{3,4}-[0-9]{3,4}".r
val commits = Seq(
Commit("1", "TST-123"),
Commit("1", "TST-123"),
Commit("2", "TST-2234"),
Commit("3", "TST-31234"),
Commit("4", "TST-4232"),
Commit("5", "TST-523"),
Commit("5", "TST123123123123-5 nkajsdnkajsnd")
)
commits flatMap (c => taskNamePattern.findFirstIn(c.title)) map ("jira/" + _)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment