Subject ODP: [firebird-support] Built in RegEx Capability?
Author Karol Bieniaszewski

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 POSITION('p', D.NAZWA)))-2) AS P

from

(SELECT 'V12 p234 The state of the nation.pdf' AS NAZWA FROM  RDB$DATABASE) D

 

Pozdrawiam,

Karol Bieniaszewski