Trying to find a specific tag in a given string with newline as below:
exp( 2pi + 1 ) - [--||value1||--]^3
round(455.6172,0)
[--||value2||455, 456, 457||--]%%3 == 0 ;
I try to use the following code to search the [--|| ||--] tag format, and it works:
preg_match("/\[--\|([\*_a-z0-9A-Z.\|])+\|--\]/", $sTagTxt)
However, if my string contain asterisk (*) as below, it won't work:
exp( 2[B][SIZE="5"][COLOR="Red"]*[/COLOR][/SIZE][/B]pi + 1 ) - [--||value1||--]^3
round(455.6172,0)
[--||value2||455, 456, 457||--]%%3 == 0 ;
Should I replace the * with other character or can escape at preg_match pattern?
Thanks.