Re: [GENERAL] Regexp + spaces PG 9.1

2017-05-30 Thread Patrick B
2017-05-31 16:34 GMT+12:00 David G. Johnston : > On Tue, May 30, 2017 at 9:17 PM, Patrick B > wrote: > >> >> regexp_matches(name, '((main|medium).name/\d+.\d+)') as filename, >> >> >> Example here: http://sqlfiddle.com/#!15/5f4f0/4 >> >>1. can only get the jpg file name >> >> ​Because those

Re: [GENERAL] Regexp + spaces PG 9.1

2017-05-30 Thread David G. Johnston
On Tue, May 30, 2017 at 9:17 PM, Patrick B wrote: > > regexp_matches(name, '((main|medium).name/\d+.\d+)') as filename, > > > Example here: http://sqlfiddle.com/#!15/5f4f0/4 > >1. can only get the jpg file name > > ​Because those are the only two file names consisting of one or more numbers,

[GENERAL] Regexp + spaces PG 9.1

2017-05-30 Thread Patrick B
Hi guys, I've got a column which stores the file name on it, the column is character varying(255). I'm selecting that value in a CTE query; basically: test1 AS ( SELECT regexp_matches(name, '((main|medium).name/\d+.\d+)') as filename, * from test1; ) select filename[1] from test1 Exa