PreviousNextTracker indexSee it online !

(232/244) 4015 - regex replace throws error when finds ) in gpl license

search for
~~~~
Although the examples have not shown a copyright notice, I have included\na copyright notice nonetheless.
~~~~
replace with nothing using dir tree in java source tree files of which there are many version numbers in it. result:
~~~~
java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 185
Although the examples have not shown a copyright notice, I have included\na copyright notice nonetheless.

This program is distributed under the terms of the GNU General Public
License.
)

^
at java.util.regex.Pattern.error(Pattern.java:1955)
at java.util.regex.Pattern.compile(Pattern.java:1700)
at java.util.regex.Pattern.<init>(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1054)
at org.gjt.sp.jedit.search.SearchAndReplace.getSearchMatcher(SearchAndReplace.java:326)
at org.gjt.sp.jedit.search.SearchAndReplace.replaceAll(SearchAndReplace.java:889)
at org.gjt.sp.jedit.search.SearchAndReplace.replaceAll(SearchAndReplace.java:855)
at org.gjt.sp.jedit.search.SearchDialog$ButtonActionHandler.actionPerformed(SearchDialog.java:1138)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
~~~~

~~~~
C:\USERS\KRISTINA\DESKTOP\PRJ\HYPRCUBE3
├───4.4-intel
│ └───src
├───classes
├───dist
│ ├───gen
│ │ └───undone
│ ├───jar
│ │ ├───META-INF
│ │ └───src
│ ├───src
│ │ ├───3.10
│ │ ├───3.11
│ │ ├───3.12
│ │ ├───3.13
│ │ ├───3.14
│ │ ├───3.15
│ │ ├───3.16
│ │ ├───3.18
│ │ ├───3.19
│ │ ├───3.6
│ │ ├───3.7
│ │ ├───3.8
│ │ ├───3.9
│ │ ├───4.0
│ │ ├───4.1
│ │ ├───4.2
│ │ ├───4.5
│ │ ├───META-INF
│ │ ├───rxtx
│ │ │ └───rxtx-2.1-7-bins-r2
│ │ │ ├───Linux
│ │ │ │ ├───i686-unknown-linux-gnu
│ │ │ │ ├───ia64-unkown-linux-gnu
│ │ │ │ └───x86_64-unknown-linux-gnu
│ │ │ ├───Mac_OS_X
│ │ │ ├───Solaris
│ │ │ │ └───sparc-solaris
│ │ │ │ └───sparc32-sun-solaris2.8
│ │ │ └───Windows
│ │ │ └───i368-mingw32
│ │ ├───src
│ │ ├───unused
│ │ ├───vef_files
│ │ └───VEF_format_files
│ ├───srclcd
│ │ ├───3.15
│ │ ├───3.16
│ │ ├───3.17
│ │ ├───3.18
│ │ ├───3.19
│ │ ├───4.0
│ │ ├───4.1
│ │ ├───4.2
│ │ ├───src
│ │ └───unused
│ └───unused
├───Hyper3lcdshutter-4D-3.15
└───src
~~~~

Submitted jmichae3 - 2016-08-24 13:26:00.935000 Assigned
Priority 5 Labels
Status open Group minor bug
Resolution None

Comments

2016-08-24 17:01:34.860000
daleanson

You'll need to provide more information, please include the exact search term (is it a regular expression, I can't tell from your description) and at least one of the files that the search is failing on.

2016-08-25 09:17:06.532000
kpouer

) is a special char in regexp, it needs to be escaped with a \