Simplify regular expressions (#4893)

* Simplify regular expressions

* Inline class declaration

Co-authored-by: Brais Gabín <braisgabin@gmail.com>
This commit is contained in:
schalkms
2022-06-01 23:38:45 +02:00
committed by GitHub
parent 8b365028ec
commit 5c41ebb2b6
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
package io.gitlab.arturbosch.detekt.api.internal
private val identifierRegex = Regex("[aA-zZ]+([-][aA-zZ]+)*")
private val identifierRegex = Regex("[aA-zZ]+(-[aA-zZ]+)*")
/**
* Checks if given string matches the criteria of an id - [aA-zZ]+([-][aA-zZ]+)* .

View File

@@ -31,4 +31,4 @@ internal fun String.withoutQuotes() = removeSurrounding(TRIPLE_QUOTES)
private const val SINGLE_QUOTES = "\""
private const val TRIPLE_QUOTES = "\"\"\""
private val STRING_CONCAT_REGEX = """["]\s*\+[\n\s]*["]""".toRegex()
private val STRING_CONCAT_REGEX = """"\s*\+[\n\s]*"""".toRegex()