.
this is the closest what I found but this returns part of regex and it do not return all of regex is ther any way to archive this even without codeql
import codeql.ruby.security.regexp.ExponentialBackTracking
import codeql.ruby.security.regexp.NfaUtils
import codeql.ruby.Regexp
from RegExpTerm t, string pump, State s, string prefixMsg
where hasReDoSResult(t, pump, s, prefixMsg)
select t,
"This part of the regular expression may cause exponential backtracking on strings " + prefixMsg +
"containing many repetitions of '" + pump + "'."
You could try using RegExpLiteral
instead of RegExpTerm
.