function _collapse_text_find_tags in Collapse Text 6.2
Same name and namespace in other branches
- 7.2 collapse_text.module \_collapse_text_find_tags()
find all of the [collapse...] tags and return an array of their locations
1 call to _collapse_text_find_tags()
- collapse_text_process in ./
collapse_text.module - Implementation of hook_filter($op='process').
File
- ./
collapse_text.module, line 303 - collapse_text is an input filter that allows text to be collapsible
Code
function _collapse_text_find_tags($text, $options) {
$matches = array();
$regex = '/
(?<!\\\\) # not proceeded by a backslash
\\[ # opening bracket
\\/? # a closing tag?
collapse # the word collapse
[^\\]]* # everything until the closing bracket
\\] # a closing bracket
/smx';
preg_match_all($regex, $text, $matches, PREG_OFFSET_CAPTURE);
return $matches[0];
}