Page 1 of 1

Need hel with Regular Expressions.

Posted: Wed Jun 10, 2009 9:10 pm
by blue
I am unable to figure out the regex for the following format:

it begins with {
ends with }
in between we can have alphabets, numbers and _

eg. {name_1}

I know its very basic, but I just can't get it right.

Re: Need hel with Regular Expressions.

Posted: Wed Jun 10, 2009 9:42 pm
by requinix

Code: Select all

/\{(\w+)\}/
Goes into one of the preg_* functions.