[Regex] How do I find values in brackets...

Associate
Joined
2 Apr 2004
Posts
674
Location
Melbourne
I am currently learning regex and its making my mind hurt a bit.

Ideally, I wish I could figure it out, but maybe one of you guys could help me.

How would I go about matching the following pattern and pulling out the value between the brackets and replacing the whole lot.

So say I have the following

Code:
{value}

and I want to replace it with

Code:
cheese

how would I do it?
 
yes it does work and it works great.

its for a simple template engine I'm writing and have used str_replace to replace the values I do know and that regex to replace all unset values.

so thanks everyone :)
 
Back
Top Bottom