.Pattern = "[^0-9A-Za-z一-龥[]]"

.Pattern = "[^0-9A-Za-z一-龥[]]"
用户252301526
2024年07月06日
|
浏览 178

我是你的AI助手。对于你提供的正则表达式模式 Pattern = "[^0-9A-Za-z一-龥[]]",这个模式将匹配除数字、大写字母、小写字母、中文字符以外的任何字符。具体解释如下:

  • [^...]:表示一个字符集合,匹配不在该字符集合内的任意字符。
  • 0-9:表示数字 0 到 9。
  • A-Z:表示大写字母 A 到 Z。
  • a-z:表示小写字母 a 到 z。
  • 一-龥:表示中文字符范围。
  • []:方括号用于表示字符集合的开始和结束。

因此,这个正则表达式模式将匹配除数字、大写字母、小写字母、中文字符以外的所有字符。

我要提问
复制内容
分享给好友
AI编程问答网 免责声明:
以上内容除特别注明外均来源于网友提问,AI编程问答网回答,权益归原著者所有;
 
上一篇:<template> <div> <el-upload :action="uploadAction" :headers="uploadHeaders" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove" :on-success="handleUploadSuccess" :file-list="imageList" :before-upload="beforeAvatarUpload" > <el-icon><Plus /></el-icon> </el-upload> <el-dialog v-model="dialogVisible"> <img width="100%" :src="dialogImageUrl" alt="" > </el-dialog> </div> </template> <script setup> import $cookie from 'vue-cookies' import { ElMessage } from 'element-plus' const uploadHeaders = { Authorization: $cookie.get('Authorization') } const uploadAction = http.adornUrl('/admin/file/upload/element') const props = defineProps({ modelValue: { default: '', type: String } }) const emit = defineEmits(['update:modelValue']) const dialogImageUrl = ref('') const dialogVisible = ref(false) const resourcesUrl = import.meta.env.VITE_APP_RESOURCES_URL const imageList = computed(() => { const res = [] if (props.modelValue) { const imageArray = props.modelValue?.split(',') for (let i = 0; i < imageArray.length; i++) { res.push({ url: resourcesUrl + imageArray[i], response: imageArray[i] }) } } emit('update:modelValue', props.modelValue) return res }) /** * 图片上传 */ // eslint-disable-next-line no-unused-vars const handleUploadSuccess = (response, file, fileList) => { const pics = fileList.map(file => { if (typeof file.response === 'string') { return file.response } return file.response.data }).join(',') emit('update:modelValue', pics) } /** * 限制图片上传大小 */ const beforeAvatarUpload = (file) => { const isJPG = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/jpg' if (!isJPG) { ElMessage.error('上传图片只能是jpeg/jpg/png/gif 格式!') } const isLt2M = file.size / 1024 / 1024 < 2 if (!isLt2M) { ElMessage.error('上传图片大小不能超过 2MB!') } return isLt2M && isJPG } // eslint-disable-next-line no-unused-vars const handleRemove = (file, fileList) => { const pics = fileList.map(file => { if (typeof file.response === 'string') { return file.response } return file.response.data }).join(',') emit('update:modelValue', pics) } const handlePictureCardPreview = (file) => { dialogImageUrl.value = file.url dialogVisible.value = true } </script> 把这个改成多视频上传