Fix: no-invalid-regexp not understand variable for flags (fixes #10112) #10113
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (template)
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?