cond vpath-regex="^/default/main does not work

Options
I am trying to apply a metadata capture rule using metatagger 3.1 and Teamsite 5.5.2 on a unix system. I have the following lines in my metadata-rules.cfg.
<metadata-rules>
<cond vpath-regex="^/default/main/Sandbox">
<rule name="Default Rule" />
</cond>
but when I try to set metadata on a .txt file in a workarea under the Sandbox branch then it gives me an error message saying that there are no rules for this file type in my metadata-rules.cfg.

However, when I use this line of code instead of the first line listed above, the metadatacapture template works but then it is applied to all branches.
<cond vpath-regex=".">

What code should i use to apply metadata to all files in the default/main/Sandbox branch with a tyw22268 workarea?

Comments

  • I just took out the ^ and now it works. What exactly does the ^ do? I thought that it was root?
  • In a regex, the "^" character, when used in the way you used it (it has other meanings when used in different contexts) means "the beginning of the line". So your original regex would only match if "/default" appeared at the beginning of the line being processed. It failed because the actual line being processed probably begins with the store name and not "/default". By taking the "^" out of the regex, it would then look for the string anywhere in the line, which would produce a match if the store name preceeded your string. Make sense? I recommend Jeffrey Friedl's Mastering Regular Expressions book (O'Reilly) to anyone doing anything with regexes.

    Dave Smith
    Sr. Software Engineer
    Nike, Inc.
    (503) 671-4238
    DavidH.Smith@nike.com
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs