Regex substring help

From: Nick <nboutelier(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Regex substring help
Date: 2009-09-03 22:22:12
Message-ID: 3ecde714-8579-45d5-adc0-e816f0e0ea4c@d9g2000prh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Im trying to get all the text before the '<br>' tag.

SELECT SUBSTRING('one<br>two<br>three','(^.*)<br>.*$');

returns "one<br>two"

How do I get it to return "one"?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2009-09-03 23:00:21 Re: Regex substring help
Previous Message Jerry LeVan 2009-09-03 22:20:47 Re: Snow Leopard and plpython problem