jmporterog / maven-replacer-plugin

Automatically exported from code.google.com/p/maven-replacer-plugin
MIT License
0 stars 0 forks source link

new feature request : back references #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. put this in the pom file
<configuration>
<file>src/main/resources/raw.sql</file>
<outputFile>src/main/resources/out.sql</outputFile>
<tokenValueMap>src/main/resources/replacements.txt</tokenValueMap>
<regex>true</regex>
</configuration>

2. put this in the raw.sql file
drop table Fred;

3. put this in the replacements.txt file
drop table ([^;]*);=begin execute immediate 'drop table \1'; exception when 
others then null; end; /

4. run the maven pom, eg: mvn clean install

What is the expected output? What do you see instead?
We should get this in the out.txt
begin execute immediate 'drop table Fred'; exception when others then null; 
end; /

What version of the product are you using? On what operating system?
1.3.8 on Win7 OS but I guess that wont affect the issue

Please provide any additional information below.
I can see that others have already made the request in the comments of the 
usage wiki page but could not see it in the actual issues raised.

Thanks

M G

Original issue reported on code.google.com by madjid.g...@gmail.com on 22 Jun 2011 at 1:14

GoogleCodeExporter commented 9 years ago
oops this should be an enhancement and not a defect, sorry

Original comment by madjid.g...@gmail.com on 22 Jun 2011 at 1:15

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Try this in your replacements.txt:
drop table ([^;]*);=begin execute immediate 'drop table $1'; exception when 
others then null; end; /

In Java, backreferences are referenced by $1, $2, etc.

Let me know how you go,
Steven

*edited: regex should be true or can be removed since true is default.

Original comment by baker.st...@gmail.com on 30 Jun 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Closing Issue. Did not receive timely feedback and suspect requested 
functionality already exists.

Original comment by baker.st...@gmail.com on 14 Jul 2011 at 3:44

GoogleCodeExporter commented 9 years ago
Sorry Just tested it ( been away ) and it works fine. Thanks

Madjid Ghazi

Original comment by madjid.g...@gmail.com on 14 Jul 2011 at 3:02