I need a regular expression to capture field names in the string. They are listed among my requirements:
- Field names in crisp brace
- No spaces in the field names
- Curly braces \ < / Li>
then in the following:
capture {this} text and out \ {that}?
Matches are {it}, but not {that}.
I am using PHP and preg_match (I can use a FIFF function, I am open to it)
Any thoughts? I care about explaining the result for this, so I can learn something :)
$ s = 'Capture {this} text and out \ {that} {a} \ {b} {c}?'; Preg_match_all ('~ (? & Lt;! \\\) {[^}] +} ~, $ s, $ match); Var_dump (matches $);
In the description, you can read about negative perception (?
Comments
Post a Comment