PREG Reg Expression to match token
Posted on 2013-01-25
Im trying to write a PREG (php) based reg expression to replace any tokens embedded within a template to "". Unfortunately, I cant seem to figure out how to properly match the tokens.
The tokens are formatted as follows:
[@ operator @]
I need to be able to replace [@ * @] with just nothing.
I have tried /[\[@] + [@\]]/, and various variations with no luck. I suspect my problem is that Im unsure as how to force the literal on the [ ], as well as unsure how to match anything in the middle.