I have this pattern:
preg_replace_callback('#@abc\((.*?)\)(.*?)@end.#is', ..
My template string:
$test = "@abc('test')<h1>test</h1>@end"; // not working
$test2 = "@abc('test')<h1>test</h1>@end "; // working
Why it doesn't work if there's no space after @end?
As @Rizier123 pointed out, this is the correct regex:
preg_replace_callback('#@abc\((.*?)\)(.*?)@end#is', ..