File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
feature/matcher/src/commonMain/kotlin/com/neoutils/neoregex/feature/matcher/model Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,12 @@ interface Syntax {
40
40
private val charSetRegex = """ (\\{2})|(\\\[)|(\[\^?)((?:\\{2}|\\\]|[^\]])*)(\])?""" .toRegex()
41
41
private val groupRegex = """ (\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\()|(\((?:\?[:=!])?)((?:\\{2}|\\\)|\\\[|\[(?:\\{2}|\\\]|[^\]])*\]?|[^\)])*)(\))?""" .toRegex()
42
42
private val quantifierRegex = """ (\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\{)|(\{\w,?\w?\})""" .toRegex()
43
- private val escapeReservedRegex = """ (\\{2})|(\\[{}()\[\]$^+*?|\w])""" .toRegex()
43
+ private val escapeReservedRegex = """ (\\{2})|(\\[{}()\[\]$^+*?|. \w])""" .toRegex()
44
44
private val escapedCharRegex = """ (\\{2})|(\\[DdWwSsHhVvR])""" .toRegex()
45
45
private val anchorsRegex = """ (\\{2})|(\\[$^])|(\\[AZzBbG])|([$^])""" .toRegex()
46
46
private val controlsRegex = """ (\\{2})|(\\[tnfrae])""" .toRegex()
47
47
private val modifierRegex = """ (\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\[+*?])|([+*?])""" .toRegex()
48
+ private val dotRegex = """ (\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\.)|(\.)""" .toRegex()
48
49
private val alternationRegex = """ (\\{2})|(\\\[)|(\[(?:\\{2}|\\\]|[^\]])*\]?)|(\\\|)|(\|)""" .toRegex()
49
50
private val charSetRangeRegex = """ \w(-)\w""" .toRegex()
50
51
@@ -125,6 +126,10 @@ interface Syntax {
125
126
put(4 , charSetSpanStyle.copy(color = Color .Unspecified ))
126
127
put(5 , charSetSpanStyle)
127
128
}
129
+
130
+ dotRegex.match {
131
+ put(5 , SpanStyle (color = escapedCharColor))
132
+ }
128
133
}
129
134
130
135
groupRegex.script { match ->
You can’t perform that action at this time.
0 commit comments