In direct observation of the previous question , how can I pull out the text (and, if possible, curly braces), as a match using PHP?
In particular, I am writing a Wordpress plugin and want to reformat all text between two curly braces (quasi-wiki marking).
I followed the steps described in the previous question I asked and processing the relevant part is a coincidence in which I need help.
Example:
This is some {{text}} and I want to reformat the items inside the curly braces
Required Conclusion:
This is some *Text fancified* and I want to reformat the items inside the curly braces
Whats mine (what doesn't work):
$content = preg_replace('#\b\{\{`.+`\}\}\b#', "<strong>$0</strong>", $content);
If the match , including the brackets, is too complicated, I can match using curly braces as offsets, and then remove the βoffensiveβ brackets using the simpler text matching function.
source share