﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28805	Add database functions for regular expressions, e.g. RegexpReplace	Joey Wilhelm	Nick Pope	"I've created a database function in my own project to utilize `REGEXP_REPLACE`, and wanted to contribute it upstream. At a quick glance, it appears that this is only available on PostgreSQL and Oracle. So my main question would be, which route would be preferable for inclusion? Should this be added to the PostgreSQL-specific code and let Oracle languish, or would this require the addition of a new feature flag on database backends?

With the former implementation, I have code ready to go. The latter, I would definitely want some guidance.

This is of course all assuming that this feature is desired.

Here is an example usage:


{{{#!python
MyModel.objects.annotate(no_letters=RegexpReplace(F('name'), r'[A-Za-z]+', ''))
}}}
"	New feature	assigned	Database layer (models, ORM)	dev	Normal			Sardorbek Imomaliev	Accepted	1	0	0	1	0	0
