How do I create a regular expression to capture {this} text and exclude \{that}?

Algoltardog

New Member
I need a regular expression to capture field names listed in a string. They are listed between Here are my requirements:[*]field names in curly braces[*]field names have no spaces[*]curly braces can be escaped with a \So in the following:\[code\]capture {this} text and exclude \{that}?\[/code\]The matches are {this} but not {that}.I'm using PHP and preg_match (i could use a diff function, i'm open to ideas)Any ideas?care to explain the result as well for me so I might learn something :)
 
Back
Top