Oliver Ashoff
2006-05-17 10:41:01 UTC
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
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-----
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
CREATE INDEX IX_2_lra_country
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 524288
NEXT 524288
PCTINCREASE 0
MINEXTENTS 2
MAXEXTENTS 2147483645
)
;
I have found the following regular expresion will match
replace all of this with the semi-colon symbol(";").
<replaceregexp byline = "false" flags = "g"
file="${sql.dir}/oracle/lra-create-index-oracle.sql"
replace=";">
</replaceregexp>
When I test this regular expression it works (but not under
CREATE INDEX IX_2_lra_country
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.
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
CREATE INDEX IX_2_lra_country
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 524288
NEXT 524288
PCTINCREASE 0
MINEXTENTS 2
MAXEXTENTS 2147483645
)
;
I have found the following regular expresion will match
replace all of this with the semi-colon symbol(";").
<replaceregexp byline = "false" flags = "g"
file="${sql.dir}/oracle/lra-create-index-oracle.sql"
replace=";">
</replaceregexp>
When I test this regular expression it works (but not under
CREATE INDEX IX_2_lra_country
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.