MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / _regexp_match

Method _regexp_match

lib/sqlalchemy/dialects/postgresql/base.py:2229–2244  ·  view source on GitHub ↗
(self, base_op, binary, operator, kw)

Source from the content-addressed store, hash-verified

2227 )
2228
2229 def _regexp_match(self, base_op, binary, operator, kw):
2230 flags = binary.modifiers["flags"]
2231 if flags is None:
2232 return self._generate_generic_binary(
2233 binary, " %s " % base_op, **kw
2234 )
2235 if flags == "i":
2236 return self._generate_generic_binary(
2237 binary, " %s* " % base_op, **kw
2238 )
2239 return "%s %s CONCAT('(?', %s, ')', %s)" % (
2240 self.process(binary.left, **kw),
2241 base_op,
2242 self.render_literal_value(flags, sqltypes.STRINGTYPE),
2243 self.process(binary.right, **kw),
2244 )
2245
2246 def visit_regexp_match_op_binary(self, binary, operator, **kw):
2247 return self._regexp_match("~", binary, operator, kw)

Calls 3

render_literal_valueMethod · 0.95
processMethod · 0.45

Tested by

no test coverage detected