ereg_to_preg.rst 602 B

1234567891011121314151617181920212223242526272829303132333435
  1. =====================
  2. Rule ``ereg_to_preg``
  3. =====================
  4. Replace deprecated ``ereg`` regular expression functions with ``preg``.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Risky if the ``ereg`` function is overridden.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. -<?php $x = ereg('[A-Z]');
  18. +<?php $x = preg_match('/[A-Z]/D');
  19. Rule sets
  20. ---------
  21. The rule is part of the following rule sets:
  22. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  23. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_