Hi David!

Inserting a new line  

   


in the regular expression so that 
line endings/transitions are matched
may help.
After that my multi-line regexp work.

I wonder if the ant regexp multi-line mode
is platform dependent as far as the line endings 
are concerned? 
Or if I missed something. :)

Regards,

Oliver




> -----Ursprüngliche Nachricht-----
> Von: David [mailto:[EMAIL PROTECTED] 
> Gesendet: Mittwoch, 17. Mai 2006 11:59
> An: Ant Apache User Group
> Betreff: How to use replaceregexp in multi-line context?
> 
> Dear members,
>    
>   I would like to use the ant task replaceregexp in order to 
> replace tablespace information on my sql scripts, my input 
> file is some think like this:
>    
>   CREATE INDEX IX_2_lra_country
>  ON @[EMAIL PROTECTED] (be_code)
>  PCTFREE    10
>   INITRANS   2
>   MAXTRANS   255
>   TABLESPACE @TABLESPACE@
>  STORAGE (
>    INITIAL     524288
>    NEXT        524288
>    PCTINCREASE 0
>    MINEXTENTS  2
>    MAXEXTENTS  2147483645
>    )
> ;
>    
>   I have found the following regular expresion will match 
> what I want: [EMAIL PROTECTED](\)]*; so I want to 
> replace all of this with the semi-colon symbol(";").
>    
>   I am ussing the following invocation of replaceregexp:
>    
>   <replaceregexp byline = "false" flags = "g"
>    file="${sql.dir}/oracle/lra-create-index-oracle.sql"
>    match="[EMAIL PROTECTED](\)]*;"
>    replace=";">
>   </replaceregexp>
>    
>   When I test this regular expression it works (but not under 
> Ant). I get:
>    
>   CREATE INDEX IX_2_lra_country
>  ON @[EMAIL PROTECTED] (be_code);
>    
>    It doesn't work with Ant because the regular expresion to 
> find is spread in more than one line. If I put all in one 
> line it matches the regular expression. I don't understand 
> why because the \s includes the newline character too. I have 
> tried to use the flag="sg" without success too and also to 
> set byline="true".
>    
>   Do you have any suggestion about that?,
>    
>   Thanks in advance,
>    
>   David
> 
>               
> ---------------------------------
> Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries 
> for just 2¢/min with Yahoo! Messenger with Voice.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to