You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mike Norman <mw...@sympatico.ca> on 2004/07/13 23:28:35 UTC

capitalize first letter of a property?

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