What regex engine does GitLab use?



  • Let's say I have a rule like this,

    - 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?



  • GitLab uses https://ruby-doc.org/core-3.1.2/Regexp.html which is https://github.com/k-takata/Onigmo . I found that from looking at the source code in Ruby's https://github.com/ruby/ruby/blob/master/regexec.c .

    Official documentation is mostly here: https://github.com/k-takata/Onigmo/blob/master/doc/RE




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2