質問するログイン新規登録

質問編集履歴

1

追記しました

2021/06/15 04:42

投稿

annindofu
annindofu

スコア13

title CHANGED
File without changes
body CHANGED
@@ -5,7 +5,24 @@
5
5
 
6
6
  該当箇所を確認したところ、
7
7
  ```ここに言語を入力
8
+ function doubleConsonant($str)
9
+ {
10
+ $c = $this->regex_consonant;
11
+
8
- return preg_match("#$c{2}$#", $str, $matches) AND $matches[0]{0} == $matches[0]{1};
12
+ return preg_match("#$c{2}$#", $str, $matches) AND $matches[0]{0} == $matches[0]{1};
13
+ }
14
+
15
+ function cvc($str)
16
+ {
17
+ $c = $this->regex_consonant;
18
+ $v = $this->regex_vowel;
19
+
20
+ return preg_match("#($c$v$c)$#", $str, $matches)
21
+ AND strlen($matches[1]) == 3
22
+ AND $matches[1]{2} != 'w'
23
+ AND $matches[1]{2} != 'x'
24
+ AND $matches[1]{2} != 'y';
25
+ }
9
26
  ```
10
27
  上記の、{}部分が原因でした。
11
28
  勉強不足で、{}の意味するところがよく分かりません、、、