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.

Bug 160807 - IllegalArgumentException: Illegal group reference
Summary: IllegalArgumentException: Illegal group reference
Status: RESOLVED DUPLICATE of bug 119819
Alias: None
Product: editor
Classification: Unclassified
Component: Search (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@editor
Depends on:
Reported: 2009-03-21 22:18 UTC by sgtgarcia
Modified: 2009-04-16 10:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 10891

stacktrace (2.91 KB, text/plain)
2009-03-21 22:19 UTC, sgtgarcia

Note You need to log in before you can comment on or make changes to this bug.
Description sgtgarcia 2009-03-21 22:18:58 UTC
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

java.lang.IllegalArgumentException: Illegal group reference
        at java.util.regex.Matcher.appendReplacement(
        at java.util.regex.Matcher.replaceFirst(
Comment 1 sgtgarcia 2009-03-21 22:19:06 UTC
Created attachment 78586 [details]
Comment 2 Vitezslav Stejskal 2009-03-23 17:21:58 UTC
Ideally the dialog should verify entered regex patterns and clearly communicate errors to the user without crashing.
Comment 3 Jiri Kovalsky 2009-03-30 14:22:00 UTC
Vita Stejskal agreed that he would review and integrate a patch for this issue contributed by the NetFIX [1] team.

Comment 4 Alexei Mokeev 2009-04-16 10:34:51 UTC
Pure duplicate of 119819

*** This issue has been marked as a duplicate of 119819 ***