php man page for preg_grep

Query: preg_grep

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

PREG_GREP(3)								 1							      PREG_GREP(3)

preg_grep - Return array entries that match the pattern

SYNOPSIS
array preg_grep (string $pattern, array $input, [int $flags])
DESCRIPTION
Returns the array consisting of the elements of the $input array that match the given $pattern.
PARAMETERS
o $pattern - The pattern to search for, as a string. o $input - The input array. o $flags - If set to PREG_GREP_INVERT, this function returns the elements of the input array that do not match the given $pattern.
RETURN VALUES
Returns an array indexed using the keys from the $input array.
EXAMPLES
Example #1 preg_grep(3) example <?php // return all array elements // containing floating point numbers $fl_array = preg_grep("/^(d+)?.d+$/", $array); ?>
SEE ALSO
PCRE Patterns, preg_quote(3), preg_match_all(3), preg_filter(3), preg_last_error(3). PHP Documentation Group PREG_GREP(3)
Related Man Pages
array(n) - redhat
array(0x13b5a0) - redhat
array(0x13b558) - redhat
array(0x80f5de) - redhat
array(0x828abb) - redhat
Similar Topics in the Unix Linux Community
Perl regular expression for exclude specific ip range
REGEX help required and some sed/awk help as well