(?:\[/\\2\])", Regex::DOT_ALL | Regex::IGNORE_WHITESPACE | Regex::CASE_INSENSITIVE);
$callback = new Callback(function ($matches) {
- return StringStack::pushToStringStack($matches[0], 'preParserCode');
+ return '['.StringStack::pushToStringStack(mb_substr($matches[0], 1, -1), 'preParserCode', "\0\0\0").']';
});
}
(?:\[/\\1\])", Regex::DOT_ALL | Regex::IGNORE_WHITESPACE | Regex::CASE_INSENSITIVE);
$callback = new Callback(function ($matches) {
- return StringStack::pushToStringStack($matches[0], 'urlBBCodes');
+ return '['.StringStack::pushToStringStack(mb_substr($matches[0], 1, -1), 'preParserCode', "\0\0\0").']';
});
}
static $userRegex = null;
if ($userRegex === null) {
$userRegex = new Regex("
- (?<=^|\s) # either at start of string, or after whitespace
+ (?:^|(?<=\s|\])) # either at start of string, or after whitespace
@
(
([^',\s][^,\s]{2,})(?:\s[^,\s]+)? # either at most two strings, not containing
# whitespace or the comma, not starting with a single quote
# separated by a single whitespace character
|
- '(?:''|[^'])*' # or a string delimited by single quotes
+ '(?:''|[^']){3,}' # or a string delimited by single quotes
)
", Regex::IGNORE_WHITESPACE);
}