显示下拉菜单

Test of preg_match() 本页面仅提供英文版本。

Example #1 : test success
Example #2 : test success
Example #3 : test success
Example #4 : test success
Example #5 : test success
Example #6 : test success
Example #7 : test success
Example #8 : test success
Example #1
$input = [
  
=> '/php/i',
  
=> 'PHP is the web scripting language of choice.',
  
=> '$matches',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
      
=> 'PHP',
    ],
    
'int' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> '_SINGLE_QUOTE_/\\bweb\\b/i_SINGLE_QUOTE_',
  
=> 'PHP is the web scripting language of choice.',
  
=> '$matches',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
      
=> 'web',
    ],
    
'int' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
=> '_SINGLE_QUOTE_/\\bweb\\b/i_SINGLE_QUOTE_',
  
=> 'PHP is the website scripting language of choice.',
  
=> '$matches',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
    ],
    
'int' => 0,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
=> '@^(?:http://)?([^/]+)@i',
  
=> 'http://www.php.net/index.html',
  
=> '$matches',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
      
=> 'http://www.php.net',
      
=> 'www.php.net',
    ],
    
'int' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #5
$input = [
  
=> '_SINGLE_QUOTE_/[^.]+\\.[^.]+$/_SINGLE_QUOTE_',
  
=> 'http://www.php.net',
  
=> '$matches',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
      
=> 'php.net',
    ],
    
'int' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #6
$input = [
  
=> '_SINGLE_QUOTE_/(?P<name>\\w+): (?P<digit>\\d+)/_SINGLE_QUOTE_',
  
=> 'foobar: 2008',
  
=> '$matches',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
      
=> 'foobar: 2008',
      
'name' => 'foobar',
      
=> 'foobar',
      
'digit' => '2008',
      
=> '2008',
    ],
    
'int' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #7
$input = [
  
=> '/^def/',
  
=> 'abcdef',
  
=> '$matches',
  
=> 'PREG_OFFSET_CAPTURE',
  
=> 3,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
    ],
    
'int' => 0,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #8
$input = [
  
=> '/^def/',
  
=> 'def',
  
=> '$matches',
  
=> 'PREG_OFFSET_CAPTURE',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'matches' => [
      
=> [
        
=> 'def',
        
=> 0,
      ],
    ],
    
'int' => 1,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]