0

This is the error: Warning: preg_match(): Compilation failed: POSIX collating elements are not supported at offset 0 in C:\xampp\htdocs\test.php on line 73

This is the code:

$string = "AishahAishahAishah, RukoyyahRukoyyahRukoyyah and KafayahKafayahKafayah";
preg_match("/[.Aishah.]+/", $string, $array);
print_r($array);
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
Aishah
  • 1
  • 1
  • Right, but you wanted `/(?:Aishah)+/`, didn't you? – Wiktor Stribiżew Feb 16 '21 at 09:26
  • i want to make "Aishah" to act has a single character so that, "Aishah{2}" for instance will means "AishahAishah" – Aishah Feb 16 '21 at 09:29
  • You can't make it a single char, since it is not, but you may just use a group and quantify the group. – Wiktor Stribiżew Feb 16 '21 at 09:30
  • Definitely i dont understand the book by o'reily, i saw this in the book:Some locales consider certain character sequences as if they were a single character— these are called collating sequences. To match one of these multicharacter sequences in a character class, enclose it with [. and .]. For example, if your locale has the collating sequence ch, you can match s, t, or ch with this character class: [st[.ch.]] – Aishah Feb 16 '21 at 09:33
  • You misunderstood this text. You can't define any text as a single char. – Wiktor Stribiżew Feb 16 '21 at 10:02

0 Answers0