php - Regular Expression, match characters between { } -
I am trying to find the text that contains a & lt; Or> between {} it is within HTML and I'm having trouble getting "ungreedy".
So I want to match the text that matches this string:
{test> 3} {test & gt; = 3: comment} {example & lt; 4}
I have tried several regular expressions, but all continue before closing) and include HTML & lt; Or> for example, I tried this rijks
{. *? (<| Lt | | & gt;) *}}
But it ends the matching text like this: <{PDF} {if true} & lt; B & gt; Trial & lt; / B & gt; {/ If}
It is very easy, in which & lt; Or <.>
This should do the trick:
{[^ }] * (& Lt; | & gt;) *}
Comments
Post a Comment