我正在寻找在Zendesk中为我的一种表单创建正则表达式票证字段。我想创建一个电话号码字段,来自澳大利亚或新西兰的客户可以在其中输入他们的电话号码。我希望该字段能够验证AUS或NZ电话号码。
我在这里有此正则表达式,非常适合验证AUS电话号码。
const fs = require('fs')
const files = [{
source: "./assets/json/adminconfig.json",
destination: "./bot/AdminOptions/Config.json"
}, {
source: "./assets/json/adminmessages.json"
destination: "./bot/AdminOptions/Messages.json"
}]
// bot reads a config
// and then saves the content of source to destination
const create_bot = () => {
// note: you could make a symbolic link
// between the data directory and the output
// but that's up to you
//
// e.g.
// const filenames = fs.readdir(data_directory).then((error, filenames) => filenames)
// we iterate through each file_object
const filenames = files.forEach(file_object => {
// read the source
fs.readFile(file_object.source, "utf-8")
.then((err, content) => {
if (err) {
console.error(`An error ocurred reading the file: ${err.message}`)
throw new Error(err);
return
}
// write the file
// (destination, content, encoding) => callback
fs.writeFile(file_object.destination, content, "utf-8")
.then((err) => {
if (err) {
console.error(`An error ocurred updating the file: ${err.message}`)
throw new Error(err);
return
}
console.log("success")
}
})
})
}
create_bot();
我需要一个正则表达式,可以根据用户输入的内容在字段中验证AUS或NZ编号。