altschule
Regular Member
- Sep 1, 2010
- 282
- 186
I'm currently am on a personal project and am trying to build my own template engine, and am running into an issue that could easily be fixed with REGEX but I just can't figure it out.
What I have at the moment is finding strings with
, but I need to find the nests and handle them first, and just cannot figure it out. For example If it was
my desired REGEX would detect the brackets with nests, and then output the [somethingcool||that] for me.
What I have now:
What I tried, but didn't work:
What I have at the moment is finding strings with
Code:
[somethinghere=this;somethingelse=that]
Code:
[somethinghere=this;somethingelse=[somethingcool||that];thenthis=thing]
What I have now:
Code:
#\[(.*?)\]#
What I tried, but didn't work:
Code:
#\[(.*?)\[(.*?)\](.*?)\]