I try to check a string with a pattern using a regex with python on a sqlite database.
I have problem when I try de search string having " with a patern using "
For exemple:
cur.execute("insert into articles(id,subject) values (1,'aaa"test"')")
cur.execute("select id,subject from articles where id = 1")
print (cur.fetchall())
cur.execute("select subject from articles where subject regexp '"test"' ")
print (cur.fetchall())
I should " before regexp other way compiler dont like... syntaxe error
[(1, 'aaa"test"')]
[] <????? should found
Somebody know how to do that ?
My regexp function :con.create_function("regexp", 2, regexp)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…