regex get string between two characters code example
Example 1: get everything between two characters regex
(?<=\[)(.*?)(?=\])
Example 2: regex get text between braces
$text = 'ignore everything except this {{ text1 }}';
preg_match('#\{\{(.*?)\}\}#', $text, $match);
var_dump($match);
Example 3: regex match two characters
echo %H#E%L#L%O! | sed 's/[#%]//g' #replaces every appearance of any of
two characters # and %