Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3536

multi / single line regular expression infinite loop

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.6.2
    • None
    • regular expressions
    • None
    • windows xp sp3 x64

    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 }
      

      Attachments

        Activity

          People

            paulk Paul King
            smartnut007 Arun Ramakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: