回答編集履歴
2
調整
answer
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
# 追記
|
11
11
|
```javascript
|
12
|
-
["testhoge","test'","test\"","test=","test-","test&39;","test""].forEach(function(x){
|
12
|
+
["testhoge","test'","test\"","test=","test-","test&39;","test"","hogehoge"].forEach(function(x){
|
13
13
|
console.log("1)"+x+":"+(!x.match(/test(?=\x22|\x27|\x2d|\x3d)/)?"ok":"ng"));
|
14
14
|
console.log("2)"+x+":"+(!x.match(/test(?=[-=]|&(39|quot);)/)?"ok":"ng"));
|
15
15
|
console.log("3)"+x+":"+(x.match(/test(?![-=]|&(39|quot);)/)?"ok":"ng"));
|
1
追記
answer
CHANGED
@@ -5,4 +5,13 @@
|
|
5
5
|
console.log("1)"+x+":"+(!x.match(/test(?=\x22|\x27|\x2d|\x3d)/)?"ok":"ng"));
|
6
6
|
console.log("2)"+x+":"+(!x.match(/test(?=[-=]|&(39|quot);)/)?"ok":"ng"));
|
7
7
|
});
|
8
|
+
```
|
9
|
+
|
10
|
+
# 追記
|
11
|
+
```javascript
|
12
|
+
["testhoge","test'","test\"","test=","test-","test&39;","test""].forEach(function(x){
|
13
|
+
console.log("1)"+x+":"+(!x.match(/test(?=\x22|\x27|\x2d|\x3d)/)?"ok":"ng"));
|
14
|
+
console.log("2)"+x+":"+(!x.match(/test(?=[-=]|&(39|quot);)/)?"ok":"ng"));
|
15
|
+
console.log("3)"+x+":"+(x.match(/test(?![-=]|&(39|quot);)/)?"ok":"ng"));
|
16
|
+
});
|
8
17
|
```
|