ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Norman <mwnor...@sympatico.ca>
Subject capitalize first letter of a property?
Date Tue, 13 Jul 2004 21:28:35 GMT
I have an admittedly-silly requirement that a property:

    application=foo

also have a corresponding property:

    uc_application=Foo

So, I have successfully built a regex pattern:

<property
	file="foo.properties"
/>
<loadproperties
	srcFile="foo.properties"
	>
	<filterchain>
		<prefixlines
			prefix="uc_"
		/>
	</filterchain>
	<filterchain>
		<tokenfilter>
			<replaceregex
				pattern="application=(\w)(.+)"
				replace="application=toupper(\1)\2"
			/>
		</tokenfilter>
	</filterchain>
</loadproperties>

However, I can't seem to figure out the 'replace' part. Is there a way
to get the first group ('\1' - the letter 'f' in the above case) to
be capitalized?

Thanks in advance,

Mike Norman


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message