[GENERAL] Substring question

2004-12-13 Thread Adam Witney
I am trying to select a part of a text field based on a regular expression, the data looks like this Rv0001c_f Rv0002_r Rv1003c_r Etc I would like to be able to select like this (this is a regular expression I would do in perl) SELECT substring(primer_name, '(\w+)\d\d\d\d[c]*_[fr]$') from

Re: [GENERAL] Substring question

2004-12-13 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: On Mon, Dec 13, 2004 at 06:17:27PM +, Adam Witney wrote: I would like to be able to select like this (this is a regular expression I would do in perl) Remember that the backslash (\) already has a special meaning in PostgreSQL string literals.

Re: [GENERAL] Substring question

2004-12-13 Thread Michael Fuhr
On Mon, Dec 13, 2004 at 06:17:27PM +, Adam Witney wrote: I am trying to select a part of a text field based on a regular expression, the data looks like this Rv0001c_f Rv0002_r Rv1003c_r Etc I would like to be able to select like this (this is a regular expression I would do in