fork(1) download
  1. <?php
  2.  
  3. function test($re1, $re2) {
  4. if (preg_match($re1,$re1)) {
  5. echo "$re1 self-matches\n";
  6. }
  7. if (preg_match($re2,$re2)) {
  8. echo "$re2 self-matches\n";
  9. }
  10.  
  11. if (preg_match($re1, $re2) && preg_match($re2, $re1)) {
  12. echo "$re1 and $re2 works\n";
  13. }
  14. else echo "$re1 and $re2 doesn't work\n";
  15. }
  16.  
  17. test('/A$/', '/.A/A');
  18.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
/A$/ and /.A/A works