SQLite
SQLite
基本流程
|
|
常用语句
|
|
常用函数
sqlite3_exec()
,称为便捷函数,封装了好多任务。
所有文章
|
|
|
|
sqlite3_exec()
,称为便捷函数,封装了好多任务。
元字符 | 描述 |
---|---|
. | 句号匹配任意单个字符除了换行符。 " .ar " => The car parked in the garage. |
[ ] | 匹配方括号内的任意字符 " [Tt]he " => The car parked in the garage. |
[^ ] | 否定的字符种类。匹配除了方括号里的任意字符 " [^c]ar => The car parked in the garage. |
* | 匹配>=0个重复的在*号之前的字符。 " [a-z]* " => The car parked in the garage #21. |
+ | 匹配>=1个重复的+号前的字符。 " c.+t " => The fat cat sat on the mat. |
? | 标记?之前的字符为可选. " [T]?he " => The car is parked in the garage. |
{n,m} | 匹配num个大括号之前的字符或字符集 (n <= num <= m). 0~9之间匹配最少2位,最多3位的数字:" [0-9]{2,3} " => The number was 9.9997 but we rounded it off to 10.0.0~9之间匹配只是2位的数字:" [0-9]{2,} " => The number was 9.9997 but we rounded it off to 10.0.0~9之间匹配3位数字:" [0-9]{3} " => The number was 9.9997 but we rounded it off to 10.0. |
(xyz) | 字符集,匹配与 xyz 完全相等的字符串. "`(c |
| | 或运算符,匹配符号前或后的字符. “`(T |
\ | 转义字符,用于匹配一些保留的字符 [ ] ( ) { } . * + ? ^ $ \ | "`(f |
^ | 从开始行开始匹配 `[T |
$ | 从末端开始匹配 " (at\.) ” =>The fat cat. sat. on the mat." (at\.$) "=>The fat cat. sat. on the mat. |
简写 | 描述 |
---|---|
. | 除换行符外的所有字符 |
\w | 匹配所有字母数字,等同于 [a-zA-Z0-9_] |
\W | 匹配所有非字母数字,即符号,等同于: [^\w] |
\d | 匹配数字: [0-9] |
\D | 匹配非数字: [^\d] |
\s | 匹配所有空格字符,等同于: [\t\n\f\r\p{Z}] |
\S | 匹配所有非空格字符: [^\s] |
\f | 匹配一个换页符 |
\n | 匹配一个换行符 |
\r | 匹配一个回车符 |
\t | 匹配一个制表符 |
\v | 匹配一个垂直制表符 |
\p | 匹配 CR/LF(等同于 \r\n ),用来匹配 DOS 行终止符 |
符号 | 描述 |
---|---|
?= | 正先行断言-存在 “`(T |
?! | 负先行断言-排除 “`(T |
?<= | 正后发断言-存在 “`(?<=(T |
?<! | 负后发断言-排除 “`(?<!(T |
标志 | 描述 |
---|---|
i | 忽略大小写。 " The/gi " => The fat cat sat on the mat. |
g | 全局搜索。 " .(at)/gi " => The fat cat sat on the mat. |
m | 多行修饰符:锚点元字符 ^ $ 工作范围在每行的起始。 |
默认贪婪匹配,意味着会匹配尽可能长的子串