fork(2) download
  1. <?php
  2.  
  3. $inputs = [
  4. 'test',
  5. 'Test',
  6. 'TestĄę',
  7. 'TestĄę TestĄę',
  8. 'Te02stĄę Te34stĄę',
  9. 'TestĄę TestĄę'
  10. ];
  11.  
  12. foreach ($inputs as $input) {
  13. var_dump($input, preg_match('#^[0-9\\pL]+(?: [0-9\\pL]+)*$#u', $input));
  14. }
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
string(4) "test"
int(1)
string(4) "Test"
int(1)
string(8) "TestĄę"
int(1)
string(17) "TestĄę TestĄę"
int(1)
string(21) "Te02stĄę Te34stĄę"
int(1)
string(18) "TestĄę  TestĄę"
int(0)