正则表达式填写多行时提示用户需要转换成竖杠(|)符号

This commit is contained in:
GoEdgeLab
2023-05-27 14:44:39 +08:00
parent c2ff1ffc0c
commit 27d63a6c03
6 changed files with 20 additions and 4 deletions

View File

@@ -122,6 +122,21 @@ Tea.context(function () {
}
}
this.convertValueLine = function () {
let value = this.rule.value
if (value != null && value.length > 0) {
let lines = value.split(/\n/)
let resultLines = []
lines.forEach(function (line) {
line = line.trim()
if (line.length > 0) {
resultLines.push(line)
}
})
this.rule.value = resultLines.join("|")
}
}
/**
* 正则测试
*/