This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
071022. Trying to regexp search and replace: @@([A-Z_]+)@@ with ${$1} on e.g. @@FOO@@ Probably the replacement syntax was wrong, but this was not a very polite way to tell me so.
Created attachment 51515 [details] Stack trace
Reproducible in a dev build.
moving opened issues from TM <= 6.1 to TM=Dev
Still the case for 6.7 trunk (20090408): java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java:713) at java.util.regex.Matcher.replaceFirst(Matcher.java:861) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:253) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceResult(DocumentFinder.java:312) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findReplaceInBlock(EditorFindSupport.java:596) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findReplaceImpl(EditorFindSupport.java:525) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.replace(EditorFindSupport.java:693)
*** Issue 160807 has been marked as a duplicate of this issue. ***
A brilliant summary from 160807 -- Ideally the dialog should verify entered regex patterns and clearly communicate errors to the user without crashing. --
suggested fix: with regedp option on, check entered string on typing and disable replace/find buttons and provide red colored message at the bottom of replace dialog if pattern is wrong. need to try if it will look good with some empty space if all is ok.
http://hg.netbeans.org/jet-main/rev/07c6aa8d366e finally no additional label was added, red colored search/replace strings are used to show problems. replace is disabled if pattern is wrong.
Integrated into 'main-golden', will be available in build *200904230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/07c6aa8d366e User: sergeyp@netbeans.org Log: fix #119819 added online verification for search string and replace string, find replace buttons are disabled in case of error, corresponding text field is highlighted with red.