ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: regexpreplace help...
Date Tue, 16 Aug 2005 06:28:09 GMT
just thoughts:
- load the file into property <loadfile>
- extract only \5 <antcontrib:propertyregexp>
- increment that property <antcontrib:math>
- use the result-property instead of \5 in <replaceregexp>

Jan

>-----Urspr√ľngliche Nachricht-----
>Von: Mark Lybarger [mailto:mlybarger@gmail.com] 
>Gesendet: Montag, 15. August 2005 17:10
>An: Ant Users List
>Betreff: Re: regexpreplace help...
>
>one other thing, here's my regex mapping.
>
><replaceregexp file="default-server.conf.work"
>match="RewriteRule \^/apps/(.*)?/\(\.\*\)\? 
>/(.*)?/(\d\.)(\d\.)(\d+)/a/\$1 \[R\]"
>replace="RewriteRule \^/apps/\1/\(\.\*\)\? /\2/\3\4\5/a/\$1 \[R\]"
>byline="true"/>
>
>on the replace item 5 (\5), i'd like to increment the number 
>by one. can i do this?
>
>On 8/15/05, Mark Lybarger <mlybarger@gmail.com> wrote:
>> 
>> thanks, it is indeed in the manual.
>> 
>> On 8/15/05, Jan.Materne@rzf.fin-nrw.de < Jan.Materne@rzf.fin-nrw.de>
>> wrote:
>> > 
>> > The manual shows how to get the back-references... 
>> > 
>> > Jan
>> > 
>> > >-----Urspr√ľngliche Nachricht-----
>> > >Von: Mark Lybarger [mailto:mlybarger@gmail.com]
>> > >Gesendet: Montag, 15. August 2005 15:27
>> > >An: Ant Users List
>> > >Betreff: Re: regexpreplace help...
>> > >
>> > >Thanks jan,
>> > >
>> > ><replaceregexp file="default-server.conf.work"
>> > >match="RewriteRule \^/apps/(.*)?/\(\.\*\)\? 
>/(.*)?/(.*)?/a/\$1 \[R\]" 
>> > >replace="RewriteRule \^/apps/$1/\(\.\*\)\? /$2/REPL/a/\$1 \[R\]"
>> > >byline="true"/>
>> > >
>> > >i'm trying to use a $1, $2 notation in the replacement 
>pattern, but 
>> > >the output contains a literal $1, $2, as oppose to the match from 
>> > >the first and second (.*)?.
>> > >
>> > >
>> > >
>> > >On 8/15/05, Jan.Materne@rzf.fin-nrw.de < 
>> > >Jan.Materne@rzf.fin-nrw.de> wrote:
>> > >>
>> > >> <replaceregexp>
>> > >>
>> > >> Jan
>> > >>
>> > >> >-----Urspr√ľngliche Nachricht-----
>> > >> >Von: Mark Lybarger [mailto: mlybarger@gmail.com]
>> > >> >Gesendet: Montag, 15. August 2005 14:25
>> > >> >An: Ant Users List
>> > >> >Betreff: regexpreplace help...
>> > >> >
>> > >> >I'm not much of a regex person, and maybe there's an 
>easier way 
>> > >> >to accomplish this.
>> > >> >
>> > >> >I've got an apache config file for using url rewriting. The 
>> > >> >rewrite rules look something like:
>> > >> >
>> > >> >RewriteRule ^/apps/MyApp/(.*)? /MyApp/1.0.62/a/$1 [R] 
>> > >> >RewriteRule ^/apps/MyNextApp/(.*)? /MyNextApp/1.0.62/a/$1 [R] 
>> > >> >RewriteRule ^/apps/MyNextOtherApp/(.*)? 
>> > >> >/MyNextOtherApp/1.0.62/a/$1 [R]
>> > >> >
>> > >> >basically, the 1.0.62 is a version number that gets bumped
>> > >when ever
>> > >> >we want to release a new version. this allows the client to
>> > >cache the
>> > >> >web content indefinately, and never even check, with the
>> > >server for a
>> > >> >new version. what i need to do is to do a search and
>> > >replace on this
>> > >> >file finding the 1.0.62, and replacing it with 1.0.63.
>> > >rather simple
>> > >> >in a text editor, maybe someone else has done something
>> > >similar with
>> > >> >ant? 
>> > >> >
>> > >> >thanks!
>> > >> >
>> > >>
>> > >> 
>-----------------------------------------------------------------
>> > >> ---- 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
>> > 
>> > 
>>
>

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


Mime
View raw message