Portfolio regex to exclude projects

I’m trying to configure portfolio manager using a regular expression to include all projects except for projects starting with a specific string.

  • SonarVersion: SonarQube 7.9.3 Enterprise edition
  • I want to configure portfolio manager to show all projects except those matching a string.
  • I’ve tried using various regex patterns to achieve this, but have not successfully excluded any projects.

[^ projectx]

Thanks

I wanted to exclude all project Names matching "^mystring.*'

This worked for me: ^(?!mystring).*$

The documentation should really contain a link to the reference implementation of regex, or better examples than the most basic one.

@ganncamp,
Oddly, I have two projectKey which also match the the exclusion pattern and yet they appear, so even though the text says:
“A valid regular expression, eg. “.*Business” to match project names or keys that end with “Business””
it seems it’s only working on Names, not keys ? is that correct ?

Hey @ianw

Please refrain from tagging people that aren’t engaged on a thread. It’s highly discouraged in this community, and probably has the opposite effect of the one you want (Ann & I knock threads we’re tagged on directly to the bottom of our respective lists).

The regular expression should apply on names and keys (we’d like to eventually restrict this to keys – [SONAR-10745] Project selection by regexp should only be matched on project key and not project name - SonarSource). Do you have an example project key that’s not being excluded?