回答編集履歴
2
修正:regexpの個数一致を「\+」から「\*」に
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
「漢字とひらがな」のみは`[\u4E00-\u9FFF\u3040-\u309Fー]
|
1
|
+
「漢字とひらがな」のみは`[\u4E00-\u9FFF\u3040-\u309Fー]*`が正解のようですね。
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<form onSubmit="alert('ok');event.preventDefault()">
|
12
12
|
|
13
|
-
<input pattern="[\u4E00-\u9FFF\u3040-\u309Fー]
|
13
|
+
<input pattern="[\u4E00-\u9FFF\u3040-\u309Fー]*" value="a0" required autofocus placeholder="漢字/ひらがな">
|
14
14
|
|
15
15
|
<button>送信</button>
|
16
16
|
|
1
修正:不足していた参考文献の追記
test
CHANGED
@@ -17,3 +17,11 @@
|
|
17
17
|
</form>
|
18
18
|
|
19
19
|
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
参考
|
24
|
+
|
25
|
+
---
|
26
|
+
|
27
|
+
> [unicode - Regular expressions (regex) in Japanese - Stack Overflow](http://stackoverflow.com/questions/10809176/regular-expressions-regex-in-japanese)
|