diff --git a/packages/grafana-flamegraph/src/FlameGraph/colors.ts b/packages/grafana-flamegraph/src/FlameGraph/colors.ts index b8b8a472ff8..5e7a5c868e1 100644 --- a/packages/grafana-flamegraph/src/FlameGraph/colors.ts +++ b/packages/grafana-flamegraph/src/FlameGraph/colors.ts @@ -112,9 +112,9 @@ export function getBarColorByDiff( // the language from the backend and use the right regex but right now we just try all of them from most to least // specific. const matchers = [ - ['phpspy', /^(?(.*\/)*)(?.*\.php+)(?.*)$/], - ['pyspy', /^(?(.*\/)*)(?.*\.py+)(?.*)$/], - ['rbspy', /^(?(.*\/)*)(?.*\.rb+)(?.*)$/], + ['phpspy', /^(?([^\/]*\/)*)(?.*\.php+)(?.*)$/], + ['pyspy', /^(?([^\/]*\/)*)(?.*\.py+)(?.*)$/], + ['rbspy', /^(?([^\/]*\/)*)(?.*\.rb+)(?.*)$/], [ 'nodespy', /^(\.\/node_modules\/)?(?[^/]*)(?.*\.?(jsx?|tsx?)?):(?.*):(?.*)$/,