Skip to content

Commit

Permalink
Simplify regular expressions (#4893)
Browse files Browse the repository at this point in the history
* Simplify regular expressions

* Inline class declaration

Co-authored-by: Brais Gabín <braisgabin@gmail.com>
  • Loading branch information
schalkms and BraisGabin committed Jun 1, 2022
1 parent 8b36502 commit 5c41ebb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -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]+)* .
Expand Down
Expand Up @@ -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()

0 comments on commit 5c41ebb

Please sign in to comment.