Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.6.2
-
Fix Version/s: None
-
Component/s: regular expressions
-
Labels:None
-
Environment:windows xp sp3 x64
-
Number of attachments :
Description
//groovy version 1.6.2 //this script seems to go on an infinite loop in the last line def str = '''ID_843110_DATE 2008-08-26 02:53:25 ID_843110_SRC This is a test ID_843110_TRG Aceasta este o incercare ''' def id = 843110 def m = str =~ /(?s)^ID_($id)_DATE\n.*\nID_($id)_SRC\n(.*\n)+ID_($id)_TRG\n(.*\n)+/ m.each { println it } m = str =~ /(?s)^ID_($id)_DATE\n.*\nID_($id)_SRC\n(.*)+ID_($id)_TRG\n(.*\n)+/ m.each{ println it }
Activity
Paul King
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
//groovy version 1.6.2 //this script seems to go on an infinite loop in the last line def str = '''ID_843110_DATE 2008-08-26 02:53:25 ID_843110_SRC This is a test ID_843110_TRG Aceasta este o incercare ''' def id = 843110 def m = str =~ /(?s)^ID_($id)_DATE\n.*\nID_($id)_SRC\n(.*\n)+ID_($id)_TRG\n(.*\n)+/ m.each { println it } m = str =~ /(?s)^ID_($id)_DATE\n.*\nID_($id)_SRC\n(.*)+ID_($id)_TRG\n(.*\n)+/ m.each{ println it } |
{code} //groovy version 1.6.2 //this script seems to go on an infinite loop in the last line def str = '''ID_843110_DATE 2008-08-26 02:53:25 ID_843110_SRC This is a test ID_843110_TRG Aceasta este o incercare ''' def id = 843110 def m = str =~ /(?s)^ID_($id)_DATE\n.*\nID_($id)_SRC\n(.*\n)+ID_($id)_TRG\n(.*\n)+/ m.each { println it } m = str =~ /(?s)^ID_($id)_DATE\n.*\nID_($id)_SRC\n(.*)+ID_($id)_TRG\n(.*\n)+/ m.each{ println it } {code} |
Paul King
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Paul King [ paulk ] | |
| Resolution | Won't Fix [ 2 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
This is present in Java too:
And from looking at the Java bug database, it doesn't seem like Java tries to police such dangerous expressions, e.g.:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4704828