Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread David G. Johnston
On Tue, Dec 29, 2015 at 2:26 PM, Michael Nolan wrote: > On Mon, Dec 28, 2015 at 2:08 PM, Christopher Molnar > wrote: > >> Hello all! >> >> Sorry to have to ask the experts here for some regex assistance again. I >> am admittadly awful with these and could use some help. >> >> Any suggestions? >>

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Michael Nolan
On Mon, Dec 28, 2015 at 2:08 PM, Christopher Molnar wrote: > Hello all! > > Sorry to have to ask the experts here for some regex assistance again. I > am admittadly awful with these and could use some help. > > Any suggestions? > I have found over the years that it is far easier to write a short

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christoph Moench-Tegeder
## Melvin Davidson (melvin6...@gmail.com): > UPDATE pcilms_assign >SET intro = REPLACE (intro, 'HVACR1114_LAB_13A.pdf', > '&file=HVACR1114_LAB_13A.pdf') > WHERE intro like 'https://owncloud.porterchester.edu%' > AND course=18 and id=55413; Unfortunately, that tries to do the right th

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christoph Moench-Tegeder
## Christopher Molnar (cmolna...@gmail.com): > I have tried something like: > > update pcilms_assign set intro=regexp_replace(intro, '/([^/]*)\" title=$', > '&files=\1') where intro like '%https://owncloud.porterchester.edu%' and > course=18 and id=55413; http://blog.codinghorror.com/parsing-ht

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Melvin Davidson
Chris, First, even though it may or may not apply in this instance, it is ALWAYS a good idea (and good manners) to provide the PostgreSQL version and your O/S when posting to this board. I have also previously replied that the following should work: UPDATE pcilms_assign SET intro = REPLACE (i

[GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christopher Molnar
Hello all! Sorry to have to ask the experts here for some regex assistance again. I am admittadly awful with these and could use some help. Have the following string (this is an example) that needs to be changed. Need to use a search and replace because the links across over 200K records are simi

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Christopher Molnar
Thank you Felix that was exactly what I needed! -Chris On Mon, Dec 28, 2015 at 2:23 PM, Félix GERZAGUET wrote: > Hello Chris, > > On Mon, Dec 28, 2015 at 8:10 PM, Christopher Molnar < > cmol...@ourworldservices.com> wrote: > >> Any suggestions? >> > This seems to works: > > select regexp_replac

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Melvin Davidson
Although, in this particular case, it is not version or O/S specific, it is generally a good policy (and manners) to state them whenever contacting this mail list. In that way, future users that refer back to problems have it documented as to which are and are not version specific. On Mon, Dec 28,

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread David G. Johnston
On Mon, Dec 28, 2015 at 12:25 PM, Melvin Davidson wrote: > Will this work? > > UPDATE your_table >SET your_column = REPLACE (your_column, 'HVACR1114_LAB_13A.pdf', > '&file=HVACR1114_LAB_13A.pdf') > WHERE ; > > Your mileage may vary because you have not stated your VERSION of > PostgreSQL or

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread David G. Johnston
On Mon, Dec 28, 2015 at 12:10 PM, Christopher Molnar < cmol...@ourworldservices.com> wrote: Given this... > 'Complete the attached lab and submit via dropbox\rhttps://owncloud.porterchester.edu/HVACR/PCI_GasHeat/GasElectrical/HVACR1114_LAB_13A.pdf"; > title="Lab 13A">Lab 13A<\a>' > ​I have no cl

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Melvin Davidson
Will this work? UPDATE your_table SET your_column = REPLACE (your_column, 'HVACR1114_LAB_13A.pdf', '&file=HVACR1114_LAB_13A.pdf') WHERE ; Your mileage may vary because you have not stated your VERSION of PostgreSQL or your O/S. On Mon, Dec 28, 2015 at 2:10 PM, Christopher Molnar < cmol...@ou

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Félix GERZAGUET
Hello Chris, On Mon, Dec 28, 2015 at 8:10 PM, Christopher Molnar < cmol...@ourworldservices.com> wrote: > Any suggestions? > This seems to works: select regexp_replace('Complete the attached lab and submit via dropbox\rhttps://owncloud.porterchester.edu/HVACR/PCI_GasHeat/GasElectrical/HVACR1114_

[GENERAL] Regex help again (sorry, I am bad at these)

2015-12-28 Thread Christopher Molnar
Sorry to have to ask the experts here for some regex assistance again. I am admittadly awful with these and could use some help. Have the following string (this is an example) that needs to be changed. Need to use a search and replace because the links across over 200K records are similar but not