You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by samuel cheung <sy...@gmail.com> on 2006/07/25 17:20:49 UTC

How can I use regular expression in task?

Hi,

How can I use regular expression in <replace> task?

I have an ant call like this:

<replace file="A.java" token="A implements IField1, IField2, IField3"
value="public class Field" />

how can I use regular expressesion to replace "IField1, IField2,
IField3" with any characters? So that this replace will still work
even if I 'A' implements more interface?

Thank you.

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


Re: How can I use regular expression in task?

Posted by Dominique Devienne <dd...@gmail.com>.
You can't. You must use <replaceregexp> instead. --DD

On 7/25/06, samuel cheung <sy...@gmail.com> wrote:
> Hi,
>
> How can I use regular expression in <replace> task?
>
> I have an ant call like this:
>
> <replace file="A.java" token="A implements IField1, IField2, IField3"
> value="public class Field" />
>
> how can I use regular expressesion to replace "IField1, IField2,
> IField3" with any characters? So that this replace will still work
> even if I 'A' implements more interface?
>
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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