language: PHP (php 5.2.11)
date: 101 days 3 hours ago
link:
visibility: public
1
2
3
4
5
6
<?php
 
$string  = 'something plan-free something-else type-fuckoff';
$matches = array();
$regex   = preg_match('/(?:type|plan)-([^\s]+)/', $string, $matches);
var_dump($matches);
  • upload with new input
  • result: Success     time: 0.02s    memory: 13112 kB     returned value: 0

    <?php
    
    $string  = 'something plan-free something-else type-fuckoff';
    $matches = array();
    $regex   = preg_match_all('/(?:(?:type|plan)-([^\s]+))/g', $string, $matches);
    var_dump($matches);
    array(2) {
      [0]=>
      string(9) "plan-free"
      [1]=>
      string(4) "free"
    }