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.
Build: NetBeans IDE Dev (Build 200902231810) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33 OS: Linux, 2.6.27-13-generic, i386 User Comments: rptmaestro: This error occured while I was performing a search and replace in a sql file GUEST: Doing a "find and replace" using regular expressions. I wasn't sure how to put newline characters ("\n") in the "Replace With:" box. I tried \n, which just rendered "n", then i tried $n, which resulted in this error. sgtgarcia: Search and replace in file whith regular expression in search GUEST: Search and replace using regexp mschovanek: to reproduce: ----------- 1) in a editor window invoke Find & Replace 2) check Regular Expressions box 3) find: a replace: ${a} ERROR: IDE throws the IAE We should improve the way how IDE handles this RE errors. Eg. in FCS build user can easily miss it. GUEST: Doing a search and replace with $$ in the replacement text petiex: find replace with regular expressions Stacktrace: 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.replaceAll(EditorFindSupport.java:779)
Created attachment 78586 [details] stacktrace
Ideally the dialog should verify entered regex patterns and clearly communicate errors to the user without crashing.
Vita Stejskal agreed that he would review and integrate a patch for this issue contributed by the NetFIX [1] team. [1] http://wiki.netbeans.org/NetFIX
Pure duplicate of 119819 *** This issue has been marked as a duplicate of 119819 ***