s novell wrote:

> I have a date attribute coming from csv and it could be any of the
> following format...
>
> 01/01/2012
> 1/01/2012
> 01/1/2012
> 1/1/2012
>
> and I wanted to normalize it to 01/01/2012 (dd/mm/yyyy) format using
> regex or any other way. Could someone help me with it.


<do-reformat-op-attr name="SomeDateFormat">
<arg-value type="string">
<token-replace-all regex="^0?(\d)/0?(\d)/(\d+)$" replace-with="$1/$2/$3">
<token-local-variable name="current-value"/>
</token-replace-all>
</arg-value>
</do-reformat-op-attr>