perltest.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. The perltest program
  2. --------------------
  3. The perltest.pl script tests Perl's regular expressions; it has the same
  4. specification as pcretest, and so can be given identical input, except that
  5. input patterns can be followed only by Perl's lower case modifiers and certain
  6. other pcretest modifiers that are either handled or ignored:
  7. /+ recognized and handled by perltest
  8. /++ the second + is ignored
  9. /8 recognized and handled by perltest
  10. /J ignored
  11. /K ignored
  12. /W ignored
  13. /S ignored
  14. /SS ignored
  15. /Y ignored
  16. The pcretest \Y escape in data lines is removed before matching. The data lines
  17. are processed as Perl double-quoted strings, so if they contain " $ or @
  18. characters, these have to be escaped. For this reason, all such characters in
  19. the Perl-compatible testinput1 file are escaped so that they can be used for
  20. perltest as well as for pcretest. The special upper case pattern modifiers such
  21. as /A that pcretest recognizes, and its special data line escapes, are not used
  22. in the Perl-compatible test file. The output should be identical, apart from
  23. the initial identifying banner.
  24. The perltest.pl script can also test UTF-8 features. It recognizes the special
  25. modifier /8 that pcretest uses to invoke UTF-8 functionality. The testinput4
  26. and testinput6 files can be fed to perltest to run compatible UTF-8 tests.
  27. However, it is necessary to add "use utf8; require Encode" to the script to
  28. make this work correctly. I have not managed to find a way to handle this
  29. automatically.
  30. The other testinput files are not suitable for feeding to perltest.pl, since
  31. they make use of the special upper case modifiers and escapes that pcretest
  32. uses to test certain features of PCRE. Some of these files also contain
  33. malformed regular expressions, in order to check that PCRE diagnoses them
  34. correctly.
  35. Philip Hazel
  36. January 2012