Regex: How to get all contents inside a tag #[SOME TEXT HERE] -


I am working on the simple tokens replacement facility of my product I have solved almost all the issues but I remember one thing. Is coming. A token features should support, and one attribute can also be a token. It is part of a big project Hope you can help.

The beginning tag is "** # [**" and the closing tag is "**] **" . Say, # [first name], # [last name], # [age, constipation = "unknown"].

I am currently using this expression "\ # \ [[\ ^ \]] + \]" . I have this job but it failed on this input:

  blah blah text here ... ** # [IsFreeShipping, WhenTrue = "& lt; img src = '/ images / fw_freeshipping .gif '/ & gt; & lt; a href =' http: //www.hellowebsite.net/freeshipping.aspx'> $ [freeShipping] & lt; / a & gt; "] ** Blah Blah Text Here Also ...  

it fails to encode for the first time], it stops there, it gives it:

  * # [ IsFreeShipping, when true = "& lt; img src = '/ images / fw_freeshipping.gif' / & gt; & lt; a href = 'http: //www.hellowebsite .net / freeshipping.aspx' & gt; $ [ Product_FreeShipping] *  

My desired result should be

< Pre> * # [IsFreeShipping, WhenTrue = "& lt; Img src = '/ images / fw_freeshipping.gif' / & gt; & Lt; A href = 'http: //www.hellowebsite.net/freeshipping.aspx'> $ [Freestyle shipping] & lt; / A & gt; "] *

first < / Strong> Mail everything up to the ending square bracket.

If you want to match nested class brackets, you have to specify that what is valid when nested. For example, you can say The square brackets can be nested when quotes are made Engage in Non.


Comments