Hi Tom
> "Rui Martins" <[EMAIL PROTECTED]> writes:
>> My reasoning is:
>> Why would the exact same sub-expression, return different results when
>> either preceded or followed by something.
>
> It *isn't* returning different results; you are testing for different
> things in these two cases, namel
"Rui Martins" <[EMAIL PROTECTED]> writes:
> But the sub-expression did "match" !
No, the sub-expression "(something)" did not match. What did match
is the larger expression "(something)?". You seem to be failing
to recognize that these are two different things. If you put the
capturing parenthe
"Rui Martins" <[EMAIL PROTECTED]> writes:
> My reasoning is:
> Why would the exact same sub-expression, return different results when
> either preceded or followed by something.
It *isn't* returning different results; you are testing for different
things in these two cases, namely whether there is
> "Rui Martins" <[EMAIL PROTECTED]> writes:
>> Even though this can me though as argumentative, think about this
>> expression:
>
>> (something)?
>
>> Will "match" with an empty string in the context of a full expression,
>> and
>> will return an EMPTY String. So by analogy, I would expect it, to r
"Rui Martins" <[EMAIL PROTECTED]> writes:
> Even though this can me though as argumentative, think about this expression:
> (something)?
> Will "match" with an empty string in the context of a full expression, and
> will return an EMPTY String. So by analogy, I would expect it, to return
> the sa
Hi Tom
What I meant is:
SELECT '' ~ '^(something)?$'
This will match, i.e. the empty string will match with the expression,
and substring would return and empty string.
or in other words:
it returns true
SELECT SUBSTRING( '', '^(something)?$' )
This will also match, has a global expres
Hi Tom
Just a side note, See comments below.
> "Rui Martins" <[EMAIL PROTECTED]> writes:
>> Description:Incorrect RegExp substring Output
>
>>SUBSTRING( BedNo FROM '^[[:digit:]]+[a-zA-Z]*(:[[:digit:]]+)?$' )
>
> Interesting. It had never occurred to me that it's possible for the
"Rui Martins" <[EMAIL PROTECTED]> writes:
> Here the context of the word "match" may be misleading us, in this
> conversation.
> I say this, because in my report, the second substring expression, the one
> for RoomSize:
> SUBSTRING( BedNo, '^[[:digit:]]+([a-zA-Z]*)(:[[:digit:]]+)?$' ) AS RoomSize,
> "Rui Martins" <[EMAIL PROTECTED]> writes:
>> Description:Incorrect RegExp substring Output
>
>>SUBSTRING( BedNo FROM '^[[:digit:]]+[a-zA-Z]*(:[[:digit:]]+)?$' )
>
> Interesting. It had never occurred to me that it's possible for the
> whole pattern to have a match when some pare
"Rui Martins" <[EMAIL PROTECTED]> writes:
> Description:Incorrect RegExp substring Output
>SUBSTRING( BedNo FROM '^[[:digit:]]+[a-zA-Z]*(:[[:digit:]]+)?$' )
Interesting. It had never occurred to me that it's possible for the
whole pattern to have a match when some parenthesized
10 matches
Mail list logo