diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 8e77417..739744b 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -660,8 +660,9 @@ class SchedulerPlugin(base.Plugin): sched = dict([(pid, (cmd, option, scheduler, priority, affinity, regex)) for pid, cmd in processes]) sched_all.update(sched) - regex = str(regex).replace("(", r"\(") - regex = regex.replace(")", r"\)") + # make any contained regexes non-capturing: replace "(" with "(?:", + # unless the "(" is preceded by "\" or followed by "?" + regex = re.sub(r"(?