[ create a new paste ] login | about

Link: http://codepad.org/OrY6d67A    [ raw code | output | fork ]

PHP, pasted on Jul 13:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

$values = array(
  'anyword_ui',
  'random_ui',
  'bad_string',
  'foo_bar',
);

$filtered = preg_grep('/([a-z]\w+)\_((ui)+)/is', $values);
$count = count($filtered);

var_dump($count);


Output:
1
int(2)


Create a new paste based on this one


Comments: