Maria DB에서 정규식 치환하기
· 약 1분
MySQL에서는 정규식 치환 함수가 없지만 Maria에서는 REGEX_REPLACE
함수로 제공된다.
사용법
구문
REGEXP_REPLACE(subject, pattern, replace)
예제
SELECT REGEXP_REPLACE('[email protected]', '(graceful)(light)\.(.*)', '\\1 \\3 \\2');
/* 결과 */
'graceful [email protected] light'