fix(desktop/wallet): fixed regex for derivation path as Qt 5.15 regex

on Linux does not support named groups
This commit is contained in:
Ivan Belyakov 2023-05-15 15:58:39 +02:00 committed by Stefan Dunca
parent 6ff8683338
commit b24648de09
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,8 @@ Item {
id: d
// d flag and named capture groups not supported in Qt 5.15. Use multiple regexes instead
readonly property var derivationPathRegex: /^m\/44[|']\/?(?:(?<coin_type_h>.*?)[|'])?(?<coin_type_s>.*?)(?:\/(?<account>.*?)[|']?)?(?:\/(?<change>.*?))?((?:\/.*?)?)$/
// Captured groups: ?<coin_type_h> ?<coin_type_s> ?<account> ?<change>
readonly property var derivationPathRegex: /^m\/44[|']\/?(?:(.*?)[|'])?(.*?)(?:\/(.*?)[|']?)?(?:\/(.*?))?((?:\/.*?)?)$/
// The expected characters before each group. Workaround to missing capture group offsets in Qt 5.15
readonly property var offsets: [6, 0, 2, 2]