function bueditor_check_match in BUEditor 6
Same name and namespace in other branches
- 5 bueditor.module \bueditor_check_match()
- 6.2 bueditor.inc \bueditor_check_match()
- 7 bueditor.inc \bueditor_check_match()
Check matching lines of the needle in haystack.(page and textarea id)
1 call to bueditor_check_match()
- bueditor_preset_textarea in ./
bueditor.module - Insert textarea id into preset of the editor.
File
- ./
bueditor.module, line 255
Code
function bueditor_check_match($needle, $haystack) {
if ($needle == '') {
return FALSE;
}
$needle = '/^' . preg_replace("/\r\n?|\n/", '|', str_replace(array(
'*',
'-',
'/',
), array(
'.*',
'\\-',
'\\/',
), trim($needle))) . '$/';
return preg_match($needle, $haystack);
}