mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
HIghlight named capture in regex find string
This commit is contained in:
parent
96b53723b4
commit
ca527b3014
@ -2,6 +2,15 @@
|
||||
Change Log
|
||||
==========================
|
||||
|
||||
4.0.7 (unreleased)
|
||||
--------------------------
|
||||
|
||||
### Improvements
|
||||
|
||||
- Highlight named capture where highlight regular expression patterns such as in the find panel.
|
||||
|
||||
|
||||
|
||||
4.0.6 (465)
|
||||
--------------------------
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// © 2018-2020 1024jp
|
||||
// © 2018-2021 1024jp
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -85,7 +85,7 @@ enum RegularExpressionSyntaxType {
|
||||
// -> [abc] will be extracted in ranges(in:) since regex cannot parse nested []
|
||||
return [
|
||||
escapeIgnorer + "\\.", // .
|
||||
escapeIgnorer + "\\\\" + "[^AbGZzQE1-9]", // all escaped characters
|
||||
escapeIgnorer + "\\\\" + "[^AbGkZzQE1-9]", // all escaped characters
|
||||
escapeIgnorer + "\\\\" + "[sdDefnrsStwWX]", // \s, \d, ...
|
||||
escapeIgnorer + "\\\\" + "v", // \v
|
||||
escapeIgnorer + "\\\\" + "\\\\", // \\
|
||||
@ -102,10 +102,11 @@ enum RegularExpressionSyntaxType {
|
||||
return [
|
||||
escapeIgnorer + "\\$[0-9]", // $0
|
||||
escapeIgnorer + "\\\\[1-9]", // \1
|
||||
escapeIgnorer + "\\\\k<[a-zA-Z][a-zA-Z0-9]+>", // \k<name>
|
||||
]
|
||||
case .symbol:
|
||||
return [
|
||||
escapeIgnorer + "\\(\\?(:|>|#|=|!|<=|<!|-?[ismwx]+:?)", // (?...
|
||||
escapeIgnorer + "\\(\\?(:|>|#|=|!|<=|<!|-?[ismwx]+:?|<[a-zA-Z][a-zA-Z0-9]*>)", // (?...
|
||||
escapeIgnorer + "[()|]", // () |
|
||||
escapeIgnorer + "(\\[\\^?|\\])", // [^ ]
|
||||
escapeIgnorer + "\\\\[QE]", // \Q ... \E
|
||||
|
Loading…
Reference in New Issue
Block a user