Upgrade to Pro — share decks privately, control downloads, hide ads and more …

正規表現再入門/introduction-to-regex

shin1x1
November 03, 2016

 正規表現再入門/introduction-to-regex

2016/11/03 PHPカンファレンス2016

shin1x1

November 03, 2016
Tweet

More Decks by shin1x1

Other Decks in Programming

Transcript

  1. /TQBDFT B 1)1 1)1  NT NT   NT

    NT    NT NT    NT  NT QSFH@SFQMBDF aT 
  2. /TQBDFT B 1)1 1)1  NT NT   NT

    NT   NT NT    NT
 aT ൺ  NT aT ൺ QSFH@SFQMBDF aT 
  3. 1)1Ͱ࣮ߦ D .BTBTIJ4IJOCBSB!TIJOY <?php
 preg_match('/(a+)+$/', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaX', $m);
 
 $error =

    preg_last_error();
 if ($error === PREG_BACKTRACK_LIMIT_ERROR) {
 echo 'backtrack limit error', PHP_EOL;
 } else if ($error > 0) {
 echo 'other error', PHP_EOL;
 } $ php redos.php backtrack limit error