regexp not working with database proxy (sqlite)
How are you initializing your proxy? i.e., what is the database instance you are passing to it to initialize it?

Additionally, Peewee does not automatically register a user-defined regexp implementation for sqlite. The `playhouse.sqlite_ext.SqliteExtDatabase` *does* allow you to register a REGEXP user-defined function - [documentation](http://docs.peewee-orm.com/en/latest/peewee/sqlite_ext.html#SqliteExtDatabase):

```python
from playhouse.sqlite_ext import SqliteExtDatabase

# Instantiate the sqlite-ext db, and tell it we want to register a regexp function.
db = SqliteExtDatabase('my_database.db', regexp_function=True)
```

Using the standard `peewee.SqliteDatabase` it is also possible to register a user-defined function. You **do not** need to do any crazy shit like hand-editing the code. Here are the docs for registering a user-defined function: http://docs.peewee-orm.com/en/latest/peewee/api.html#SqliteDatabase.func

Example:

```python
db = SqliteDatabase('my_app.db')

@db.func()
def regexp(expr, s):
    return re.search(expr, s) is not None
```

--------

Now, regarding the use of `Proxy` - you cannot register user-defined functions using proxy database, as this is a sqlite-only feature. So you would do something like this:

```python
db = Proxy()

# ... define models, whatever

# Whenever you actually *do* initialize your proxy db, *at that time* you would
# register the user-defined regexp func.
sqlite_db = SqliteDatabase('my_app.db')
db.initialize(sqlite_db)

@db.func()
def regexp(expr, s):
    return re.search(expr, s) is not None
```
When I try to execute a query with regex (using the regex() method) on a database with proxy I get an error.
This is the table I am operating on:

```from peewee import *
proxy = Proxy()

class BaseModel(Model):
    class Meta:
        database = proxy

class Table2(BaseModel):
    column1= TextField(null=True)
    column2= TextField(null=True)
```

The error:
> Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/peewee.py", line 2875, in execute_sql
    cursor.execute(sql, params or ())
sqlite3.OperationalError: no such function: REGEXP

Printing the .sql() method returns
> ('SELECT "t1"."id", "t1"."column1", "t1"."column2" FROM "TABLE2" AS "t1" WHERE (("t1"."column1" = ?) AND ("t1"."column2" REGEXP ?))', ['app_name_1', '.*'])

I tried to execute the regex method on a database connection without proxy, and it worked as expected. Printing the .sql() method returned different value

> ('SELECT "t1"."id" FROM "TABLE" AS "t1" WHERE ("t1"."name" ~ %s)', ['.* 4'])

PS: I made some changes to peewee.py (in class SqliteDatabase):
- I created a new function:  
 ```
def regexp(self, expr, item):
    reg = re.compile(expr) 
    return reg.search(item) is not None
```  
- Under the function `_connect`, after `sqlite3.connect`, I added the following line:
`conn.create_function("REGEXP", 2, self.regexp)`

After these updates, regex worked on a database accessed via proxy.

