In my project, I have a form. Please see below:
here, I have two fields, HTMl and CSS. User can save their template by saving this form. Currently, I saved HTML and css as a separate field in my database. I need to prepare a template with valid data. So, I fetch the HTML from database. Please see the questions below: *** When I fetch the HTML. It's a string.
I need to catch two numbers(1 and 5) from #{item(1, 5)} using regular expression. what will be the pattern?
I need to catch
<div class="layout">....</div>
block by using regular expression. What will be the pattern?I need to replace #{url} with valid data by using regular expression. What will be the pattern?
Here is HTML with custom tag:
#{if(total,0)}#{else}
<div id="recommend">
<div class="title"><p>Title</p></div>
#{item(1,5)}
<div class="layout">
<div class="item">
<a href="#{url}"><img border="0" alt="#{name}" src="#{image}"></a>
</div>
<div class="goods">
<a href="#{url}">#{truncate(name,27)}</a>
</div>
<div class="price">#{comma(price_tax)}</div>
</div>
#{/item}
<br clear="all">
</div>
#{/if}
Please help me.