Skip to content

DQ - Enable regex named backreferences in algorithm references

This MR enables histogram matched using named backreferences to use algorithm with reference with same_name e.g.:

hist far(?P<side>A|C)side_or_near(?P=side)side {
}

dir (?P<station>(far|near)[AC]side) {
  hist whatever_(?P=station) {
  }
}

Note that the backreference to dir name can be used in hist name, because first, the full path is concatenated before the regex is matched.

This MR also fixes the closing brace counting in han-config-check.sh. Previously, it counted end of a named backreference at the end of line (e.g. in output attribute) as an end of a block. E.g.:

hist whatever_(?<ref>.*) {
  output = whatever/${ref}
}

The new condition requires that the closing brace is the first non-whitespace character on a line.

Edited by Petr Fiedler

Merge request reports