|
1 | | -const { InstanceBase, Regex, runEntrypoint, InstanceStatus } = require('@companion-module/base') |
| 1 | +const { InstanceBase, runEntrypoint, InstanceStatus } = require('@companion-module/base') |
2 | 2 | const UpgradeScripts = require('./upgrades') |
3 | 3 | const UpdateActions = require('./actions') |
4 | 4 | const UpdateFeedbacks = require('./feedbacks') |
5 | 5 | const UpdateVariableDefinitions = require('./variables') |
6 | 6 | const UpdatePresetDefinitions = require('./presets') |
7 | | -const { format, escape } = require('string-kit') |
| 7 | +const { format } = require('string-kit') |
8 | 8 | const numfmt = require('numfmt') |
9 | 9 |
|
10 | 10 | class DataEntryInstance extends InstanceBase { |
@@ -290,13 +290,13 @@ class DataEntryInstance extends InstanceBase { |
290 | 290 | buildRegex(string) { |
291 | 291 | const parts = string.match(/^\/(.+)\/([gmiyusvd]?)$/) |
292 | 292 | if (parts === null) { |
293 | | - return new RegExp('^\b$') // if input is not a valid regexp, return valid regexp which never matches |
| 293 | + return /(?!)/ // if input is not a valid regexp, return valid regexp which never matches |
294 | 294 | } else { |
295 | 295 | try { |
296 | 296 | return new RegExp(parts[1], parts[2]) |
297 | 297 | } catch (error) { |
298 | 298 | this.log('error', `Cannot compile regular expression from "${string}", ${error.message}`) |
299 | | - return new RegExp('^\b$') |
| 299 | + return /(?!)/ |
300 | 300 | } |
301 | 301 | } |
302 | 302 | } |
@@ -416,7 +416,7 @@ class DataEntryInstance extends InstanceBase { |
416 | 416 | } else { |
417 | 417 | let locstr = locale[0] |
418 | 418 | locstr = locstr.replaceAll('}{', '|') |
419 | | - locstr = locstr.replaceAll(/[\{\}]/g, '') |
| 419 | + locstr = locstr.replaceAll(/[{}]/g, '') |
420 | 420 | let locales = locstr.split('|') |
421 | 421 |
|
422 | 422 | if (locales.length === 1) { |
|
0 commit comments