http://blog.csdn.net/wugewuge/article/details/7704996 postgresql中使用正则表达式时需要使用关键字“~”,以表示该关键字之前的内容需匹配之后的正则表达式,若匹配规则不需要区分大小写,可以使用组合关键字“~*”: 相反,若需要查询不匹配这则表达式的记录,只需在该关键字前加否定关键字“!”即可.若正则表达式包含转义字符,则需在表达式前加关键字“E”. 例如: select * from user where email ~ '^[A-H]
PostgreSQL正则表达式 基础: Operator Description Example ~ Matches regular expression, case sensitive 'thomas' ~ '.*thomas.*' ~* Matches regular expression, case insensitive 'thomas' ~* '.*Thomas.*' !~ Does not match regular expression, case sensitive 'thoma