Re: SUBSTRING for a regular expression - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: SUBSTRING for a regular expression
Date
Msg-id bdc8c0d4932ec6c6e53636c6bc06d7bd@biglumber.com
Whole thread Raw
In response to SUBSTRING for a regular expression  (<btober@computer.org>)
Responses Re: SUBSTRING for a regular expression
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


SELECT
  SUBSTRING(description FROM '(.*), \\d{1,3},') AS vname,
  SUBSTRING(description FROM '.*, (\\d{1,3}),') AS age,
  SUBSTRING(description FROM '\\d{1,3}, of (.*?),? was charged')
    AS address,
  SUBSTRING(description FROM ' was charged ([^ ]+)') AS dow,
  SUBSTRING(description FROM ' was charged [^ ]+ with (.+)') AS charge
FROM police_log;

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200407062103
-----BEGIN PGP SIGNATURE-----

iD8DBQFA60wAvJuQZxSWSsgRAuKPAJ0QAeG0hdoJ/Ofqq/lXVtwMjyzQjACgoer3
kwPy0xvRiZxwr3cgPq6Rjwc=
=mF/C
-----END PGP SIGNATURE-----



pgsql-general by date:

Previous
From: Clodoaldo Pinto Neto
Date:
Subject: Re: could not access file "$libdir/plpython" when restoring
Next
From: David Helgason
Date:
Subject: Re: Syntax question