Skip to content

Extracts the first substring that matches a regular expression pattern.

func.regexp_extract(<str>, <pattern>[, <group>])
func.regexp_extract('price: $42.50', '\\$(\\d+\\.\\d+)', 1)
┌─────────┐
│ '42.50' │
└─────────┘
REGEXP_EXTRACT(<str>, <pattern>[, <group>])
SELECT REGEXP_EXTRACT('price: $42.50', '\\$(\\d+\\.\\d+)', 1);
┌───────┐
│ 42.50 │
└───────┘