java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence

Jenkins JIRA | Michael Graessle | 1 year ago
  1. 0

    Currently getting an error when a stream name has a dash in the name of such as "my-stream": java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence at java.util.regex.Pattern.error(Pattern.java:1924) at java.util.regex.Pattern.escape(Pattern.java:2416) at java.util.regex.Pattern.atom(Pattern.java:2164) at java.util.regex.Pattern.sequence(Pattern.java:2046) at java.util.regex.Pattern.expr(Pattern.java:1964) at java.util.regex.Pattern.compile(Pattern.java:1665) at java.util.regex.Pattern.<init>(Pattern.java:1337) at java.util.regex.Pattern.compile(Pattern.java:1022) at hudson.plugins.perforce.PerforceSCMHelper.getTokenPattern(PerforceSCMHelper.java:220) at hudson.plugins.perforce.PerforceSCMHelper.doesPathMatchView(PerforceSCMHelper.java:196) at hudson.plugins.perforce.PerforceSCMHelper.mapToWorkspace(PerforceSCMHelper.java:182) at com.tek42.perforce.parse.Changes.getWorkspacePathForFile(Changes.java:96) at com.tek42.perforce.parse.Changes.calculateWorkspacePaths(Changes.java:90) at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:72) at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java:431) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:1073) at hudson.model.AbstractProject.checkout(AbstractProject.java:1277) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408)

    Jenkins JIRA | 1 year ago | Michael Graessle
    java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence
  2. 0

    Currently getting an error when a stream name has a dash in the name of such as "my-stream": java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence at java.util.regex.Pattern.error(Pattern.java:1924) at java.util.regex.Pattern.escape(Pattern.java:2416) at java.util.regex.Pattern.atom(Pattern.java:2164) at java.util.regex.Pattern.sequence(Pattern.java:2046) at java.util.regex.Pattern.expr(Pattern.java:1964) at java.util.regex.Pattern.compile(Pattern.java:1665) at java.util.regex.Pattern.<init>(Pattern.java:1337) at java.util.regex.Pattern.compile(Pattern.java:1022) at hudson.plugins.perforce.PerforceSCMHelper.getTokenPattern(PerforceSCMHelper.java:220) at hudson.plugins.perforce.PerforceSCMHelper.doesPathMatchView(PerforceSCMHelper.java:196) at hudson.plugins.perforce.PerforceSCMHelper.mapToWorkspace(PerforceSCMHelper.java:182) at com.tek42.perforce.parse.Changes.getWorkspacePathForFile(Changes.java:96) at com.tek42.perforce.parse.Changes.calculateWorkspacePaths(Changes.java:90) at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:72) at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java:431) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:1073) at hudson.model.AbstractProject.checkout(AbstractProject.java:1277) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408)

    Jenkins JIRA | 1 year ago | Michael Graessle
    java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence
  3. 0

    A workspace mapping containing a variable reference (example and log output below) will fail to poll for changes due to the variable not getting resolved. Manually running the build will properly resolve the variable and update the workspace view. However, when a poll is executed, the workspace view is replaced with the raw template that does not have the variable's value inserted. The variable is defined using the standard Jenkins environment variable plugin. Example: //tools/sun/jdk1.8.0_45/${JAVA_PLATFORM}/... //CLIENT_NAME/tools/${JAVA_PLATFORM}/... Poll Log: {code} Started on Jul 22, 2015 3:27:00 PM Looking for changes... Using master Read ClientSpec from: //x/java/JRX/trunk/p4client.functest.view Using master perforce client: jenkins-rxa-x64-trunk-install-windows-8-64 Read ClientSpec from: //x/java/JRX/trunk/p4client.functest.view Warning: Client Spec line invalid, ignoring. (View:) Latest submitted change selected by workspace is 889214 ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@37d2f[rxa-x64-trunk-install-windows-8-64] java.util.regex.PatternSyntaxException: Illegal repetition near index 44 //x/java/JRX/trunk/testFunc/xinstall/tools/\${JAVA_PLATFORM}/(.*) ^ at java.util.regex.Pattern.error(Unknown Source) at java.util.regex.Pattern.closure(Unknown Source) at java.util.regex.Pattern.sequence(Unknown Source) at java.util.regex.Pattern.expr(Unknown Source) at java.util.regex.Pattern.compile(Unknown Source) at java.util.regex.Pattern.<init>(Unknown Source) at java.util.regex.Pattern.compile(Unknown Source) at hudson.plugins.perforce.PerforceSCMHelper.getTokenPattern(PerforceSCMHelper.java:218) at hudson.plugins.perforce.PerforceSCMHelper.doesPathMatchView(PerforceSCMHelper.java:198) at hudson.plugins.perforce.PerforceSCMHelper.mapToWorkspace(PerforceSCMHelper.java:184) at com.tek42.perforce.parse.Changes.getWorkspacePathForFile(Changes.java:98) at com.tek42.perforce.parse.Changes.calculateWorkspacePaths(Changes.java:92) at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:74) at hudson.plugins.perforce.PerforceSCM.getCurrentDepotRevisionState(PerforceSCM.java:1354) at hudson.plugins.perforce.PerforceSCM.compareRemoteRevisionWith(PerforceSCM.java:1234) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357) at hudson.scm.SCM.poll(SCM.java:374) at hudson.model.AbstractProject._poll(AbstractProject.java:1427) at hudson.model.AbstractProject.poll(AbstractProject.java:1330) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:466) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:495) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}

    Jenkins JIRA | 1 year ago | Jason Archer
    java.util.regex.PatternSyntaxException: Illegal repetition near index 44 //x/java/JRX/trunk/testFunc/xinstall/tools/\${JAVA_PLATFORM}/(.*) ^
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    A workspace mapping containing a variable reference (example and log output below) will fail to poll for changes due to the variable not getting resolved. Manually running the build will properly resolve the variable and update the workspace view. However, when a poll is executed, the workspace view is replaced with the raw template that does not have the variable's value inserted. The variable is defined using the standard Jenkins environment variable plugin. Example: //tools/sun/jdk1.8.0_45/${JAVA_PLATFORM}/... //CLIENT_NAME/tools/${JAVA_PLATFORM}/... Poll Log: {code} Started on Jul 22, 2015 3:27:00 PM Looking for changes... Using master Read ClientSpec from: //x/java/JRX/trunk/p4client.functest.view Using master perforce client: jenkins-rxa-x64-trunk-install-windows-8-64 Read ClientSpec from: //x/java/JRX/trunk/p4client.functest.view Warning: Client Spec line invalid, ignoring. (View:) Latest submitted change selected by workspace is 889214 ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@37d2f[rxa-x64-trunk-install-windows-8-64] java.util.regex.PatternSyntaxException: Illegal repetition near index 44 //x/java/JRX/trunk/testFunc/xinstall/tools/\${JAVA_PLATFORM}/(.*) ^ at java.util.regex.Pattern.error(Unknown Source) at java.util.regex.Pattern.closure(Unknown Source) at java.util.regex.Pattern.sequence(Unknown Source) at java.util.regex.Pattern.expr(Unknown Source) at java.util.regex.Pattern.compile(Unknown Source) at java.util.regex.Pattern.<init>(Unknown Source) at java.util.regex.Pattern.compile(Unknown Source) at hudson.plugins.perforce.PerforceSCMHelper.getTokenPattern(PerforceSCMHelper.java:218) at hudson.plugins.perforce.PerforceSCMHelper.doesPathMatchView(PerforceSCMHelper.java:198) at hudson.plugins.perforce.PerforceSCMHelper.mapToWorkspace(PerforceSCMHelper.java:184) at com.tek42.perforce.parse.Changes.getWorkspacePathForFile(Changes.java:98) at com.tek42.perforce.parse.Changes.calculateWorkspacePaths(Changes.java:92) at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:74) at hudson.plugins.perforce.PerforceSCM.getCurrentDepotRevisionState(PerforceSCM.java:1354) at hudson.plugins.perforce.PerforceSCM.compareRemoteRevisionWith(PerforceSCM.java:1234) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357) at hudson.scm.SCM.poll(SCM.java:374) at hudson.model.AbstractProject._poll(AbstractProject.java:1427) at hudson.model.AbstractProject.poll(AbstractProject.java:1330) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:466) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:495) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}

    Jenkins JIRA | 1 year ago | Jason Archer
    java.util.regex.PatternSyntaxException: Illegal repetition near index 44 //x/java/JRX/trunk/testFunc/xinstall/tools/\${JAVA_PLATFORM}/(.*) ^
  6. 0

    Java PatternSyntaxException: Illegal repetition on string substitution?

    Stack Overflow | 3 years ago
    java.util.regex.PatternSyntaxException: Illegal repetition near index 0 ${fizz} ^

  1. davidvanlaatum 2 times, last 3 months ago
  2. mortalman7 1 times, last 4 months ago
  3. Christopher 5 times, last 6 months ago
6 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.util.regex.PatternSyntaxException

    Illegal/unsupported escape sequence

    at java.util.regex.Pattern.error()
  2. Java RT
    Pattern.compile
    1. java.util.regex.Pattern.error(Pattern.java:1924)
    2. java.util.regex.Pattern.escape(Pattern.java:2416)
    3. java.util.regex.Pattern.atom(Pattern.java:2164)
    4. java.util.regex.Pattern.sequence(Pattern.java:2046)
    5. java.util.regex.Pattern.expr(Pattern.java:1964)
    6. java.util.regex.Pattern.compile(Pattern.java:1665)
    7. java.util.regex.Pattern.<init>(Pattern.java:1337)
    8. java.util.regex.Pattern.compile(Pattern.java:1022)
    8 frames
  3. hudson.plugins.perforce
    PerforceSCMHelper.mapToWorkspace
    1. hudson.plugins.perforce.PerforceSCMHelper.getTokenPattern(PerforceSCMHelper.java:220)
    2. hudson.plugins.perforce.PerforceSCMHelper.doesPathMatchView(PerforceSCMHelper.java:196)
    3. hudson.plugins.perforce.PerforceSCMHelper.mapToWorkspace(PerforceSCMHelper.java:182)
    3 frames
  4. com.tek42.perforce
    Changes.getChangelistsFromNumbers
    1. com.tek42.perforce.parse.Changes.getWorkspacePathForFile(Changes.java:96)
    2. com.tek42.perforce.parse.Changes.calculateWorkspacePaths(Changes.java:90)
    3. com.tek42.perforce.parse.Changes.getChangelist(Changes.java:72)
    4. com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java:431)
    4 frames
  5. hudson.plugins.perforce
    PerforceSCM.checkout
    1. hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:1073)
    1 frame
  6. Hudson
    AbstractBuild$AbstractBuildExecution.defaultCheckout
    1. hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
    2 frames
  7. jenkins.scm
    SCMCheckoutStrategy.checkout
    1. jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    1 frame
  8. Hudson
    Executor.run
    1. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
    2. hudson.model.Run.execute(Run.java:1741)
    3. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    4. hudson.model.ResourceController.execute(ResourceController.java:98)
    5. hudson.model.Executor.run(Executor.java:408)
    5 frames