반응형
Regular Expression Match Operators
Operator | Description | Example |
---|---|---|
~ | Matches regular expression, case sensitive | 'thomas' ~ '.*thomas.*' |
~* | Matches regular expression, case insensitive | 'thomas' ~* '.*Thomas.*' |
!~ | Does not match regular expression, case sensitive | 'thomas' !~ '.*Thomas.*' |
!~* | Does not match regular expression, case insensitive | 'thomas' !~* '.*vadim.*' |
POSIX regular expressions provide a more powerful means for pattern matching than the
LIKE
and SIMILAR TO
operators. Many Unix tools such as egrep, sed, or awk use a pattern matching language that is similar to the one described here. A regular expression is a character sequence that is an abbreviated definition of a set of strings (a regular set). A string is said to match a regular expression if it is a member of the regular set described by the regular expression. As with
LIKE
, pattern characters match string characters exactly unless they are special characters in the regular expression language --- but regular expressions use different special characters than LIKE
does. Unlike LIKE
patterns, a regular expression is allowed to match anywhere within a string, unless the regular expression is explicitly anchored to the beginning or end of the string. Some examples:
'abc' ~ 'abc' true 'abc' ~ '^a' true 'abc' ~ '(b|d)' true 'abc' ~ '^(b|c)' false
http://database.sarang.net/database/postgres/manual/manual-7.3/functions-matching.html
반응형
'Story > postgresql' 카테고리의 다른 글
그누보드 게시판 글작성시 submit 버튼을 이미지 버튼으로 교체시 문제 해결 (0) | 2017.10.27 |
---|---|
postgres 특정 테이블만 백업 (0) | 2011.11.15 |
postgres dump (0) | 2011.11.15 |
postgresql backup (0) | 2009.02.28 |
디비 언어설정때문에 한글정렬이 안될경우 (0) | 2009.01.19 |