Regexp MULTILINE mode to find & delete a multi line XML stanza [message #1735506] |
Mon, 20 June 2016 13:44 |
Paul Roubekas Messages: 207 Registered: March 2012 Location: Chattanooga, TN USA |
Senior Member |
|
|
I have a lot of XML configuration files where I need to remove the following....
<filteredResources>
<filter>
<id>1396938000000</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-true-false-target</arguments>
</matcher>
</filter>
</filteredResources>
As per the help text of the find dialog
http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
is the implementation engine of Eclipse find.
With Regular expression checked, all of the following find "Containing text:" string have not worked.
<filteredResources>.+<\/filteredResources>(?m).
(?m).<filteredResources>.+<\/filteredResources>
My guess is that since the XML stanza covers more than one line I need to turn on MULTILINE mode.
http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#MULTILINE
I found this little explanation, and came up with the following "Containing text", but it does not work either.
(?m)<filteredResources>.++$(\r\n?|\n)^.*+$(\r\n?|\n)^<\/filteredResources>
But it does not seem to be working. What is the proper way to use the
(?m).
token in the find string?
Oxygen 3a
Windows 10
[Updated on: Mon, 20 June 2016 14:01] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08277 seconds