Project

General

Profile

« Previous | Next » 

Revision 13514

schemas/util.sql: added regexp_match()

View differences:

trunk/schemas/util.sql
3077 3077

  
3078 3078

  
3079 3079
--
3080
-- Name: regexp_match(text, text); Type: FUNCTION; Schema: util; Owner: -
3081
--
3082

  
3083
CREATE FUNCTION regexp_match(str text, re text) RETURNS text[]
3084
    LANGUAGE sql IMMUTABLE
3085
    AS $_$
3086
SELECT match FROM regexp_matches($1, $2) match LIMIT 1/*only 1st match*/
3087
$_$;
3088

  
3089

  
3090
--
3080 3091
-- Name: regexp_matches_group(text, text, integer); Type: FUNCTION; Schema: util; Owner: -
3081 3092
--
3082 3093

  

Also available in: Unified diff