Subject | Re: [firebird-support] Built in RegEx Capability? |
---|---|
Author | Mark Rotteveel |
Post date | 2019-02-12T09:47:13Z |
On 12-2-2019 10:34, Mark Rotteveel mark@...
[firebird-support] wrote:
before %), as I have noticed that quotes make the quoted part greedy,
while otherwise it is non-greedy.
Eg
substring(x similar 'V#"[[:DIGIT:]]+#"%.pdf' escape '#') yields '12'
but
substring(x similar 'V[[:DIGIT:]]+#"%#".pdf' escape '#')
yields '2 p234 The state of the nation'
--
Mark Rotteveel
[firebird-support] wrote:
> In your case, you will need 3 separate substrings:I just noticed that it is safer to use 'V#"[[:DIGIT:]]+#" %.pdf' (space
>
> select x,
> substring(x similar 'V#"[[:DIGIT:]]+#"%.pdf' escape '#') as VERSION,
before %), as I have noticed that quotes make the quoted part greedy,
while otherwise it is non-greedy.
Eg
substring(x similar 'V#"[[:DIGIT:]]+#"%.pdf' escape '#') yields '12'
but
substring(x similar 'V[[:DIGIT:]]+#"%#".pdf' escape '#')
yields '2 p234 The state of the nation'
--
Mark Rotteveel