Changeset 5566
- Timestamp:
- 06/30/07 16:25:10 (1 year ago)
- Files:
-
- django/trunk/docs/db-api.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/db-api.txt
r5556 r5566 1177 1177 ~~~~~ 1178 1178 1179 **New in Django development version** 1180 1179 1181 Case-sensitive regular expression match. 1180 1182 1181 The regular expression syntax is that of the database backend in use; for the 1182 ``sqlite`` backend, the syntax is that of Python's ``re`` module. 1183 The regular expression syntax is that of the database backend in use. In the 1184 case of SQLite, which doesn't natively support regular-expression lookups, the 1185 syntax is that of Python's ``re`` module. 1183 1186 1184 1187 Example:: … … 1194 1197 SELECT ... WHERE title ~ '^(An?|The) +'; -- PostgreSQL 1195 1198 1196 SELECT ... WHERE title REGEXP '^(An?|The) +'; -- sqlite 1197 1198 Using raw strings for passing in the regular expression syntax is recommended. 1199 1200 Regular expression matching is not supported on the ``ado_mssql`` backend; it 1201 will raise a ``NotImplementedError``. 1199 SELECT ... WHERE title REGEXP '^(An?|The) +'; -- SQLite 1200 1201 Using raw strings (e.g., ``r'foo'`` instead of ``'foo'``) for passing in the 1202 regular expression syntax is recommended. 1203 1204 Regular expression matching is not supported on the ``ado_mssql`` backend. 1205 It will raise a ``NotImplementedError`` at runtime. 1202 1206 1203 1207 iregex 1204 1208 ~~~~~~ 1205 1209 1210 **New in Django development version** 1211 1206 1212 Case-insensitive regular expression match. 1207 1213 … … 1218 1224 SELECT ... WHERE title ~* '^(an?|the) +'; -- PostgreSQL 1219 1225 1220 SELECT ... WHERE title REGEXP '(?i)^(an?|the) +'; -- sqlite1226 SELECT ... WHERE title REGEXP '(?i)^(an?|the) +'; -- SQLite 1221 1227 1222 1228 Default lookups are exact
