patternMinor
What regex engine does GitLab use?
Viewed 0 times
enginewhatgitlabdoesregexuse
Problem
Let's say I have a rule like this,
It occurs to me that
Where is the GitLab Regex documented? What Regex implementation do they use?
- if: '$CI_COMMIT_TITLE =~ /^(fix|feat|perf|docs|build|test|ci|refactor)\S*:/'It occurs to me that
^ does not match the start of any line in a multiline regex, only the start of the first line. That raises the question,- Does anything match the newline?
- Is there a multi-line regex mode?
Where is the GitLab Regex documented? What Regex implementation do they use?
Solution
GitLab uses Ruby's core regex implementation which is Onigmo (Oniguruma-mod). I found that from looking at the source code in Ruby's
Official documentation is mostly here: https://github.com/k-takata/Onigmo/blob/master/doc/RE
regex.c.Official documentation is mostly here: https://github.com/k-takata/Onigmo/blob/master/doc/RE
Context
StackExchange DevOps Q#15827, answer score: 1
Revisions (0)
No revisions yet.