org.octopusden.octopus.vcsfacade.issue.IssueKeyParser.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vcs-facade Show documentation
Show all versions of vcs-facade Show documentation
Octopus module: vcs-facade
package org.octopusden.octopus.vcsfacade.issue
object IssueKeyParser {
private val maxProjectNameLength = 10
private val projectKeyPattern = "(?:^|[^-a-zA-Z0-9])([a-zA-Z0-9]{1,$maxProjectNameLength}-\\d+)".toRegex()
fun findIssueKeys(message: String) =
projectKeyPattern.findAll(message).map { it.groups[1]!!.value }.toList().distinct()
}