ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <rhi...@sympatico.ca>
Subject Minor replaceregexp question
Date Sat, 11 Feb 2006 21:36:06 GMT
I'm using replaceregexp in Ant 1.6.5 to transform one string to another. 
It's working perfectly but I'm having trouble making it do one small thing.

I'm trying to put a tab at the beginning of the replacement string but 
nothing I do seems to get interpreted as a tab in the replace parameter.

Here's my task:

<target name="Set_List_Format" description="Ensure that job descriptions in 
the Employment History section will appear as bulleted lists.">
 <replaceregexp file="${resume.src}\${resume.pkg}\ResumeConstants.java"
  match="^[\s]*public static final EmploymentHistoryFormats 
DESIRED_EMPLOYMENT_HISTORY_FORMAT[\s]*=[\s]*([^;]+);[\s]*$"
  replace="    public static final EmploymentHistoryFormats 
DESIRED_EMPLOYMENT_HISTORY_FORMAT = EmploymentHistoryFormats.LIST_FORMAT;"
  byline="true"/>
</target>

For the moment, I'm getting by with just hardcoding four spaces at the 
beginning of the replace parameter but there must be some way to indicate a 
tab within the replace parameter, right? If so, could someone enlighten me 
on the appropriate technique? I've tried using \t \\t and even [\s](4) at 
the start of the replace parameter but none of those worked.

I'd just like to put an actual tab at the start of a line rather than spaces 
in case I change the tab size at some point.

--
Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 10/02/2006


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


Mime
View raw message