function bueditor_check_match in BUEditor 7
Same name and namespace in other branches
- 5 bueditor.module \bueditor_check_match()
- 6.2 bueditor.inc \bueditor_check_match()
- 6 bueditor.module \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.inc - Insert textarea id into preset of the editor.
File
- ./
bueditor.inc, line 237 - Implements commonly used functions for bueditor.
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);
}