Expression "XXX*" invalid as a regular expression. Reason - Dangling meta character "X" near index 0
search cancel

Expression "XXX*" invalid as a regular expression. Reason - Dangling meta character "X" near index 0

book

Article ID: 21377

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

Problem: 

Whenever you open Workbench or the Eclipse Plug-in, you get this error message:

"Expression "*XXX*XXX*" invalid as a regular expression. Reason - Dangling meta character '*' near index 0"

When you click OK on the error it goes away and you can continue to work, but it is annoying. How can you get this error to stop displaying?

Error Message: "Expression "*XXX*XXX*" invalid as a regular expression. Reason - Dangling meta character '*' near index 0" 

Environment: 

CA Harvest SCM with Eclipse Plugin, all versions, Windows platform 

Cause: 

If you specify a Package Filter or Item search pattern that has an asterisk "*" as the first character, you will get this error. This is because filters and searches evaluate the search criteria as regular expressions (regex), and the meaning of a "*" is not the same in a regex as it is when you are matching file names at the command line.

Resolution:

You can fix this in a couple of ways.

  1. Click OK on the error and find the Package Filter Pattern or Item Pattern that begins with an "*" (these are remembered from your last usage) and clear it out then click OK to reset the saved Pattern for your next launch, or,

  2. Use Notepad to edit the local C:\Documents and Settings\[UserName]\.cascm\workspace\.metadata\.plugins\com.ca.harvest.workbench\dialog_settings.xml file. Search for the string reported in the error message "*XXX*XXX*" and replace it in this file.

    You will find an entry like this:
    <item value="*XXX*XXX*" key="REG_EXPRESSION_TEXT"/>

    replace it with this:
    <item value="" key="REG_EXPRESSION_TEXT"/>

    and save the file.

    The next time you start Workbench, the error will be gone.

 

For the Eclipse Plug-in, the file will be located at: "...\workspace\.metadata\.plugins\com.ca.harvest.team\dialog_settings.xml" 

Additional Information:

Here is the rule for regular expressions:

A "*" is invalid at the beginning of a regex. A "*" means zero or more of the previous character. Since there is nothing previous to the first character, you cannot put a "*" at the beginning of a regex.

 

Environment

Release: SCMNCR99000-12.1-Harvest-Software Change Manager-Named User-Competitive Replacem
Component: