PostgreSQLString FunctionsREGEXP_MATCH
REGEXP_REPLACE

REGEXP_MATCHString Functions

STRING_AGG

Returns an array of the first regex match.

Syntax

REGEXP_MATCH(str, pattern)

Example

Enter values below to update the example in real time.

phone
matched
contacts
-- 전화번호 패턴 추출
SELECT REGEXP_MATCH(phone, 'd{3}-d{4}-d{4}') AS matched
FROM contacts;