Alias for REGEXP_EXTRACT. Extracts the substring that matches the regular expression.
STRINGDiperbarui: 13 Jun 2026REGEXP_SUBSTR(value, regexp [, position [, occurrence]])The source string
Regular expression pattern
Starting position for the search
Default: 1
The nth occurrence to extract
Default: 1
1 SELECT 2 REGEXP_SUBSTR('Hello World 123', r'[0-9]+') as numbers;
Extract a number from a string.
1 SELECT 2 REGEXP_SUBSTR('abc123def456', r'[0-9]+', 5) as second_num;
Start the search from position 5.
Sudah paham REGEXP_SUBSTR? Latih langsung di browser
Latihan interaktif, langsung di browser.