Skip to content

Commit a2389ce

Browse files
committed
feat(highlight-pattern): improve group within the charset
1 parent e3845b0 commit a2389ce

File tree

1 file changed

+1
-1
lines changed
  • feature/matcher/src/commonMain/kotlin/com/neoutils/neoregex/feature/matcher/model

1 file changed

+1
-1
lines changed

feature/matcher/src/commonMain/kotlin/com/neoutils/neoregex/feature/matcher/model/Syntax.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ interface Syntax {
3838
) : Syntax {
3939

4040
private val charSetRegex = """(\\{2})|(\\\[)|(\[\^?)((?:\\{2}|\\\]|[^\]])*)(\])?""".toRegex()
41-
private val groupRegex = """(\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\()|(\((?:\?[:=!])?)((?:\\{2}|\\\)|\\\[|\[.*?\]|\([^\)]*\)|[^\)])*)(\))?""".toRegex()
41+
private val groupRegex = """(\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\()|(\((?:\?[:=!])?)((?:\\{2}|\\\)|\\\[|\[(?:\\{2}|\\\]|[^\]])*\]?|\([^\)]*\)|[^\)])*)(\))?""".toRegex()
4242
private val quantifierRegex = """(\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\{)|(\{\w,?\w?\})""".toRegex()
4343
private val escapeReservedRegex = """(\\{2})|(\\[{}()\[\]$^+*?|\w])""".toRegex()
4444
private val escapedCharRegex = """(\\{2})|(\\[DdWwSsHhVvR])""".toRegex()

0 commit comments

Comments
 (0)