Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- @RequestBody
- php
- MYSQL
- html
- 날짜
- null
- DB
- 문자열
- checbox
- 톰캣
- 이클립스
- Oracle
- RADIO
- 네이버스마트 에디터
- maven
- HTML5
- switch
- json
- 오라클
- SSL
- JSTL
- jquery
- 스크립트
- exception
- 한글
- 전자정부 표준프레임워크
- 호환성
- 웹 플랫폼 설치 관리자
- java
- spring form tag
Archives
- Today
- Total
개인적인 정리
[ORACLE] REGEXP_COUNT() 본문
오라클 REGEXP_COUNT()
REGEXP_COUNT()
-
REGEXP_COUNT(source_char, pattern)
REGEXP_COUNT(source_char, pattern, position, match_param)
의 형태
REGEXP_COUNT complements the functionality of the REGEXP_INSTR function by returning the number of times a pattern occurs in a source string. The function evaluates strings using characters as defined by the input character set. It retruns and integer indicating the number of occurences of pattern. If no match is found, then the function returns 0.
- source_char is a character expression that serves as the search value. It is commonly a character column and can be any of the data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.
- pattern is the regular expression. It is the usually a text literal and can be any of the data types CHAR, VARCHAR2, NCHAR, or CLOB, or NCLOB.
- REGEXP_COUNT ignores subexpression parentheses in pattern, For exampre, the pattern '123(45))' is equivalent to '12345'.
- position is a positive integer indicating the character of source_char where Oracle should begin the search. The default is 1, meaning that Oracle begins the search at the first character of source_char. After finding the first occurence of pattern, the database searches for a second occurence beginning with the first character following the first occurence.
- match_params is a text literal that lets you change the default matching behavior of the function. You can specify one or more of the following values for match_param :
- 'i' specifies case-insensitive matching.
- 'c' specifies case-sensitive matching.
- 'n' allows the period(.), which is the match-any character character, to match the newline character. If you omit this parameter, then the period does not match the newline character.
- 'm' treats the source string as multiple lines. Oracle interprets the caret(^) and dollar sign($) as the start and end, respectively, of any line anywhere in the source string, rather than only at the start or end of the entire source string. If you omit this parameter, then Oracle treats the source string as a single line.
- 'x' ignores whitespace characters. By default, whitespace characters match themselves.
If you specify multiple contradictory values, then Oracle uses the last value. For example, if you specify 'ic', then Oracle uses case-sensitive matching. If you specify a character other than those shown above, then Oracle returns an error.
If you omit match_params, then :
- The default case sensitivity is determined by the value of the NLS_SORT paramter.
- A period(.) does not match the newline character.
- The source string is treated as a single line.
SQL> SELECT REGEXP_COUNT('123123123123123', '(12)3', 1, 'i') REGEXP_COUNT FROM DUAL ;
--> 5
SQL> SELECT REGEXP_COUNT('123123123123123', '(12)3') REGEXP_COUNT FROM DUAL ;
-->
'DB > ORACLE' 카테고리의 다른 글
[Oracle]REMAINDER() (0) | 2020.06.10 |
---|---|
[Oracle]REGEXP_SUBSTR() (0) | 2020.06.08 |
[Oracle]REGEXP_REPLACE() (0) | 2020.06.08 |
[Oracle] REGEXP_INSTR() (0) | 2020.04.21 |
[Oracle] RAWTOHEX() (0) | 2020.04.14 |
[Oracle]RATIO_TO_REPORT() (0) | 2020.04.14 |
[Oracle] RANK() (0) | 2020.04.14 |
[Oracle] POWER() (0) | 2020.04.14 |
Comments