def reprocess_urls(urls, patterns, dbclient=None):
    """
    Reprocess the cached URLs which matches the pattern(s)
    """
    if not urls:
        urls = []
    if isinstance(patterns, str):
        patterns = [patterns]
    cur = dbclient.cursor()
    wheres = ['url~%s'] * len(patterns)
    query = 'SELECT url FROM urls WHERE {}'.format(' OR '.join(wheres))
    cur.execute(query, patterns)
    for row in cur.fetchall():
        urls.append(row[0])
    return urls
