From 64f20046f1d8c2c61f1c72eff99cc46c4dea3a43 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 30 Jun 2007 21:25:10 +0000 Subject: [PATCH] Edited docs/db-api.txt changes from [5555] git-svn-id: http://code.djangoproject.com/svn/django/trunk@5566 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/db-api.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/db-api.txt b/docs/db-api.txt index 51e1e65037..ab71e68774 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -1176,10 +1176,13 @@ database to add the full-text index. regex ~~~~~ +**New in Django development version** + Case-sensitive regular expression match. -The regular expression syntax is that of the database backend in use; for the -``sqlite`` backend, the syntax is that of Python's ``re`` module. +The regular expression syntax is that of the database backend in use. In the +case of SQLite, which doesn't natively support regular-expression lookups, the +syntax is that of Python's ``re`` module. Example:: @@ -1193,16 +1196,19 @@ SQL equivalents:: SELECT ... WHERE title ~ '^(An?|The) +'; -- PostgreSQL - SELECT ... WHERE title REGEXP '^(An?|The) +'; -- sqlite + SELECT ... WHERE title REGEXP '^(An?|The) +'; -- SQLite -Using raw strings for passing in the regular expression syntax is recommended. +Using raw strings (e.g., ``r'foo'`` instead of ``'foo'``) for passing in the +regular expression syntax is recommended. -Regular expression matching is not supported on the ``ado_mssql`` backend; it -will raise a ``NotImplementedError``. +Regular expression matching is not supported on the ``ado_mssql`` backend. +It will raise a ``NotImplementedError`` at runtime. iregex ~~~~~~ +**New in Django development version** + Case-insensitive regular expression match. Example:: @@ -1217,7 +1223,7 @@ SQL equivalents:: SELECT ... WHERE title ~* '^(an?|the) +'; -- PostgreSQL - SELECT ... WHERE title REGEXP '(?i)^(an?|the) +'; -- sqlite + SELECT ... WHERE title REGEXP '(?i)^(an?|the) +'; -- SQLite Default lookups are exact -------------------------