You are here

function _freelinking_match_pattern in Freelinking 6.3

Collect freelink format patterns for filtering.

1 call to _freelinking_match_pattern()
freelinking_filter in ./freelinking.module
Implementation of hook_filter().

File

./freelinking.module, line 374

Code

function _freelinking_match_pattern($separator = NULL) {
  if (!$separator) {
    $separator = ':';
  }
  $separator = preg_quote($separator);
  $option['double_bracket'] = '/(?<!\\\\)\\[\\[(.+' . $separator . '?.+)]]/Uu';
  $option['single_bracket'] = '/(?<!\\\\)\\[(.+' . $separator . '?.+)]/Uu';
  $option['markdown'] = '/(?<!\\\\)(\\[([^\\]]+)\\]\\((.+)(?:' . $separator . '(.+))?(?:\\s"(.+)")?\\))/Uu';
  return $option;
}