mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
Simplify regular expressions (#4893)
* Simplify regular expressions * Inline class declaration Co-authored-by: Brais Gabín <braisgabin@gmail.com>
This commit is contained in:
@@ -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]+)* .
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user