mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [ML] Fix file data visualizer index pattern match * also global replace . and +
This commit is contained in:
parent
8dbff4f1ef
commit
e2bdcccd92
1 changed files with 3 additions and 3 deletions
|
@ -641,10 +641,10 @@ function isIndexPatternNameValid(name, indexPatternNames, index) {
|
|||
}
|
||||
|
||||
// escape . and + to stop the regex matching more than it should.
|
||||
let newName = name.replace('.', '\\.');
|
||||
newName = newName.replace('+', '\\+');
|
||||
let newName = name.replace(/\./g, '\\.');
|
||||
newName = newName.replace(/\+/g, '\\+');
|
||||
// replace * with .* to make the wildcard match work.
|
||||
newName = newName.replace('*', '.*');
|
||||
newName = newName.replace(/\*/g, '.*');
|
||||
const reg = new RegExp(`^${newName}$`);
|
||||
if (index.match(reg) === null) { // name should match index
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue