Showing
1 changed file
with
4 additions
and
4 deletions
| ... | @@ -111,17 +111,17 @@ export default { | ... | @@ -111,17 +111,17 @@ export default { |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | }, | 113 | }, |
| 114 | - // Ursa校验 | 114 | + // Ursa校验 使用JavaScript写一个匹配字母的表达式 |
| 115 | validateUrsa(ursaMark, ursa) { | 115 | validateUrsa(ursaMark, ursa) { |
| 116 | // 分隔字符串并且转数组&去除数组空字符串 | 116 | // 分隔字符串并且转数组&去除数组空字符串 |
| 117 | let ursaList = ursa.split(";").filter((str) => str !== ""); | 117 | let ursaList = ursa.split(";").filter((str) => str !== ""); |
| 118 | // 是否有重复的 | 118 | // 是否有重复的 |
| 119 | let repeat = new Set(ursaList).size !== ursaList.length; | 119 | let repeat = new Set(ursaList).size !== ursaList.length; |
| 120 | - // 校验开头以字母开头下划线结尾的/^[a-zA-Z]*;$/ 和 校验开头以字母开头的/^[a-zA-Z]*;$/ | 120 | + // 校验开头以字母开头下划线结尾的/^[a-zA-Z]*_$/ 和 校验开头以字母开头的/^[a-zA-Z]*$/ |
| 121 | let inUrsa = ursaList.every((item) => | 121 | let inUrsa = ursaList.every((item) => |
| 122 | ursaMark | 122 | ursaMark |
| 123 | - ? /^[a-zA-Z][0-9]*_$/.test(item) | 123 | + ? /^[A-Z][0-9]*_$/.test(item) |
| 124 | - : /^[a-zA-Z][0-9]*$/.test(item) | 124 | + : /^[A-Z][0-9]*$/.test(item) |
| 125 | ); | 125 | ); |
| 126 | const ursaInfo = { | 126 | const ursaInfo = { |
| 127 | ursaMark: ursaMark, // Boolean ursa包含/不包含 | 127 | ursaMark: ursaMark, // Boolean ursa包含/不包含 | ... | ... |
-
Please register or login to post a comment