Jump to content

[SOLVED] Special characters help


Asheeown

Recommended Posts

nevermind I got it, sorry.

 

Final code

<?php
preg_match_all('/(\{(.*?)\})/', $Matches[0], $Test);
?>

 

Actually, you don't need to escape the curly braces, and you seem to have some additional captures in there as well that aren't needed (refering to the outer set of parenthesis).

Assuming there will not be any closing curly brace till the end, you can use a negated character class and one set of capturing parenthesis instead:

 

/{([^}]+)}/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.