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

Dangling meta character

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.0-beta-5
    • 1.0-beta-6
    • None
    • None

    Description

      The following compiles fine:

      output.replaceAll(
      'aaa', "P"
      )

      But the following doesn't:

      output.replaceAll(
      '???', "P"
      )

      []
      []
      Caught: java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
      ???
      ^
      java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
      ???
      ^
      at java.util.regex.Pattern.error(Pattern.java:1528)
      at java.util.regex.Pattern.sequence(Pattern.java:1645)
      at java.util.regex.Pattern.expr(Pattern.java:1545)
      at java.util.regex.Pattern.compile(Pattern.java:1279)
      at java.util.regex.Pattern.<init>(Pattern.java:1035)
      at java.util.regex.Pattern.compile(Pattern.java:779)
      at java.lang.String.replaceAll(String.java:1663)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at DataConversion.clean(DataConversion.groovy)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at DataConversion.invokeMethod(DataConversion.groovy)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at DataConversion.run(DataConversion.groovy:56)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at DataConversion.invokeMethod(DataConversion.groovy)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:332)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:329)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at DataConversion.main(DataConversion.groovy)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:329)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at groovy.lang.GroovyShell.run(GroovyShell.java:183)
      at groovy.lang.GroovyShell.main(GroovyShell.java:88)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Activity

          People

            Unassigned Unassigned
            jaquino Jonathan Aquino
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: