Re: [GENERAL] Unexpected Results from regexp_replace

2015-11-10 Thread Susan Hurst
Excellent! I tried the global flag before but I had it in the wrong place. Thanks for the quick service, David! --- Susan E Hurst Principal Consultant Email: susan.hu...@brookhurstdata.com Mobile: 314-486-3261 On 2015-11-10 14:19, David G.

[GENERAL] Unexpected Results from regexp_replace

2015-11-10 Thread Susan Hurst
I would like to extract only letters and numbers [0-9a-z] from an input string. Using regexp_replace in postgres, I get unexpected results. The pattern matching seems to stop before the end of the string value is reached. Some of the values that should have been excluded are still there.

Re: [GENERAL] Unexpected Results from regexp_replace

2015-11-10 Thread David G. Johnston
On Tue, Nov 10, 2015 at 1:12 PM, Susan Hurst wrote: > What is the trick for removing all instances of unwanted characters and > spaces? ​(g)lobal flag. SELECT regexp_replace('hello - world n', '[^0-9a-z]+', '', 'g') ​; David J.​