Re: ODP: [firebird-support] Built in RegEx Capability?

2019-02-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-02-12 18:50, Lester Caine les...@lsces.co.uk [firebird-support] wrote: > On 12/02/2019 16:36, Karol Bieniaszewski liviusliv...@poczta.onet.pl > [firebird-support] wrote: >> Select >> D.NAZWA >> , SUBSTRING(D.NAZWA FROM POSITION('V', D.NAZWA)+1 FOR POSITION('p', >> D.NAZWA)-3) AS V >> ,

Re: [firebird-support] Built in RegEx Capability?

2019-02-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-02-12 16:00, Lester Caine les...@lsces.co.uk [firebird-support] wrote: > On 12/02/2019 09:34, Mark Rotteveel m...@lawinegevaar.nl > [firebird-support] wrote: >> You may want to look at the discussion "substring similar - "Invalid >> SIMILAR TO pattern"" on the 5th of December 2018. >> >>

Re: ODP: [firebird-support] Built in RegEx Capability?

2019-02-12 Thread Lester Caine les...@lsces.co.uk [firebird-support]
On 12/02/2019 16:36, Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support] wrote: > Select > D.NAZWA > , SUBSTRING(D.NAZWA FROM POSITION('V', D.NAZWA)+1 FOR POSITION('p', > D.NAZWA)-3) AS V > , SUBSTRING(D.NAZWA FROM POSITION('p', D.NAZWA)+1 FOR POSITION(' ', > SUBSTRING(D.NAZWA

ODP: [firebird-support] Built in RegEx Capability?

2019-02-12 Thread Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support]
Hi. For your particular case you do not need regex at all. Simple substring + position. Example: Select D.NAZWA , SUBSTRING(D.NAZWA FROM POSITION('V', D.NAZWA)+1 FOR POSITION('p', D.NAZWA)-3) AS V , SUBSTRING(D.NAZWA FROM POSITION('p', D.NAZWA)+1 FOR POSITION(' ', SUBSTRING(D.NAZWA FROM

Re: [firebird-support] Built in RegEx Capability?

2019-02-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 12-2-2019 10:34, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > In your case, you will need 3 separate substrings: > > select x, > substring(x similar 'V#"[[:DIGIT:]]+#"%.pdf' escape '#') as VERSION, I just noticed that it is safer to use 'V#"[[:DIGIT:]]+#" %.pdf'

Re: [firebird-support] Built in RegEx Capability?

2019-02-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 11-2-2019 22:18, Lester Caine les...@lsces.co.uk [firebird-support] wrote: > I have some data in a table which I need to 'pull apart'. It's > essentially a ID for a reference but it's not as tidy as I would like > because of the variable length and a little variable in case although > the

Re: [firebird-support] Built in RegEx Capability?

2019-02-11 Thread Lester Caine les...@lsces.co.uk [firebird-support]
On 11/02/2019 22:22, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] wrote: > 11.02.2019 22:18, Lester caineles...@lsces.co.uk [firebird-support] wrote: >> Ideally I need to extract the 'V' element and the 'p' element into their >> own fields so I can look up Volume '12' and page '234'

Re: [firebird-support] Built in RegEx Capability?

2019-02-11 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
11.02.2019 22:18, Lester Caine les...@lsces.co.uk [firebird-support] wrote: > Ideally I need to extract the 'V' element and the 'p' element into their > own fields so I can look up Volume '12' and page '234' or list all the > pdf's for Volume '12' in page order. You could use "Regular

[firebird-support] Built in RegEx Capability?

2019-02-11 Thread Lester Caine les...@lsces.co.uk [firebird-support]
I have some data in a table which I need to 'pull apart'. It's essentially a ID for a reference but it's not as tidy as I would like because of the variable length and a little variable in case although the format is consistent. V p .pdf For example 'V12 p234 The state of the nation.pdf'