| replace | ![]() ![]() |
Domain: Valid filename pointing to existing file
Default: -
Domain: Valid filename
Default: -
Domain: Valid directoryname pointing to existing directory
Default: -
Domain: valid regular expression
Default: -
Domain: -
Default: -
Domain: a string that contains a single underscore '_', which is replaced by the variable name
Default: -
Domain: -
Default: -
Domain: string composed by g, i, m or s.
Default: non global, non caseless and singleline-
<define name="replace">
<element name="replace">
<ref name="dir_if_unless"/>
<choice>
<group>
<attribute name="file"/>
</group>
<group>
<attribute name="file"/>
<attribute name="to_file"/>
</group>
<group>
<attribute name="file"/>
<attribute name="to_directory"/>
</group>
<group>
<attribute name="to_directory"/>
<ref name="fileset"/>
</group>
</choice>
<choice>
<group>
<attribute name="token" />
<attribute name="replace" />
</group>
<group>
<attribute name="match" />
<attribute name="replace" />
</group>
<group>
<attribute name="variable_pattern" />
</group>
</choice>
<optional>
<attribute name="flags" />
</optional>
</element>
</define>
<replace file="test.txt" to_file="new_test.txt" token="foo" replace="BAR" flags="gi" />
<replace file="new_test.txt" match="([0-9]+)" replace="NUM(\1\)" flags="gi" />
<replace file="new_test.txt" match="((.)\2)" replace="[\1\]" flags="gi" />
<replace dir="${cwd}" token="123" replace="321" flags="g" >
<fileset include="@(**/*.txt)" />
</replace>
<replace file="in.txt" to_file="out.txt" variable_pattern="${_}"/>
|
Copyright © 2002-2006, Sven Ehrke mailto:ericb@gobosoft.com http://www.gobosoft.com Last Updated: 18 January 2007 |
![]() ![]() ![]() ![]() |