You are here

function patterns_parser_parse in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/parser/ \patterns_parser_parse()

Tries to parse a pattern string according to the specified format. If succesfull returns the array representation of the pattern, if not returns FALSE;


mixed $pattern A string representation of the pattern, or a pattern: array. In the latter case, the array is returned as it is, and the @param $format is ignored.

mixed $format The format against which parse the pattern string.:

string $validation_level Type of validation level to parse:

Return value

bool|array The parsed pattern or FALSE.

6 calls to patterns_parser_parse()
PatternsExportTestCase::testExportTaxonomy in tests/exporting/exporting.test
patterns_import_validate in includes/forms/
patterns_io_import_file in includes/io/
patterns_quickrun_submit in includes/forms/
Form submission handler for patterns_quickrun().
patterns_validate_pattern in includes/parser/
Check if pattern array or content from a file is valid.

... See full list


includes/parser/, line 151


function patterns_parser_parse($pattern, $format = PATTERNS_FORMAT_UNKNOWN) {
  if (empty($pattern)) {
    return FALSE;
  if (is_array($pattern)) {
    return $pattern;
  $parse_function = patterns_parser_get_parser_function($format);
  if (!$parse_function) {
    return FALSE;
  return $parse_function($pattern);