mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 23:00:25 +08:00
正则表达式填写多行时提示用户需要转换成竖杠(|)符号
This commit is contained in:
@@ -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("|")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 正则测试
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user