dbTalk Databases Forums  

regexp_like weirdness in 10G?

comp.databases.oracle.server comp.databases.oracle.server


Discuss regexp_like weirdness in 10G? in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ken Quirici
 
Posts: n/a

Default regexp_like weirdness in 10G? - 02-14-2010 , 02:55 PM






I'm getting this column contents (the column is a varchar2(200)):

'K+CS2(26)/DP'

matched by this:

regexp_like(<col-name>,'^(\d)+\(B|\d\).*DP.*')

Just in case, I also returned the column length and got 12, which is
exactly the number of
characters between the single quotes.

I thought '^' meant start-of-string, in this case, start-of-database-
column-string, so I
should not be getting a match with a string starting with 'K+CS'>

When I remove the '^' I get exactly the same results.

I'm running this test in TOAD.

Reply With Quote
  #2  
Old   
Vladimir M. Zakharychev
 
Posts: n/a

Default Re: regexp_like weirdness in 10G? - 02-14-2010 , 03:46 PM






On Feb 14, 11:55*pm, Ken Quirici <kquir... (AT) yahoo (DOT) com> wrote:
Quote:
I'm getting this column contents (the column is a varchar2(200)):

'K+CS2(26)/DP'

matched by this:

regexp_like(<col-name>,'^(\d)+\(B|\d\).*DP.*')

Just in case, I also returned the column length and got 12, which is
exactly the number of
characters between the single quotes.

I thought '^' meant start-of-string, in this case, start-of-database-
column-string, so I
should not be getting a match with a string starting with 'K+CS'

When I remove the '^' I get exactly the same results.

I'm running this test in TOAD.
Unless the booze really got hold of me, your RE says: either "^(\d)+\
(B" or "\d\).*DP.*". "\d\).*DP.*" (a digit followed by literal ")",
then at least one character, then literal "DP", then at least one
character - note that end-of-line counts as a character here)
perfectly matches the input.

RE is not for the faint-hearted. In fact, you need to be very precise
in what you're after...

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com

Reply With Quote
  #3  
Old   
Ken Quirici
 
Posts: n/a

Default Re: regexp_like weirdness in 10G? - 02-14-2010 , 04:41 PM



On Feb 14, 4:46*pm, "Vladimir M. Zakharychev"
<vladimir.zakharyc... (AT) gmail (DOT) com> wrote:
Quote:
On Feb 14, 11:55*pm, Ken Quirici <kquir... (AT) yahoo (DOT) com> wrote:





I'm getting this column contents (the column is a varchar2(200)):

'K+CS2(26)/DP'

matched by this:

regexp_like(<col-name>,'^(\d)+\(B|\d\).*DP.*')

Just in case, I also returned the column length and got 12, which is
exactly the number of
characters between the single quotes.

I thought '^' meant start-of-string, in this case, start-of-database-
column-string, so I
should not be getting a match with a string starting with 'K+CS'

When I remove the '^' I get exactly the same results.

I'm running this test in TOAD.

Unless the booze really got hold of me, your RE says: either "^(\d)+\
(B" or "\d\).*DP.*". "\d\).*DP.*" (a digit followed by literal ")",
then at least one character, then literal "DP", then at least one
character - note that end-of-line counts as a character here)
perfectly matches the input.

RE is not for the faint-hearted. In fact, you need to be very precise
in what you're after...

Regards,
* *Vladimir M. Zakharychev
* *N-Networks, makers of Dynamic PSP(tm)
* *http://www.dynamicpsp.com- Hide quoted text -

- Show quoted text -
No, the booze wasn't your problem, it was mine. I for some reason
(stupidity most likely) confused the literal \( \) with RE grouping
().

Thank you extremely much! One more brick in the wall!
Man you saved my buttons.

Reply With Quote
  #4  
Old   
Ken Quirici
 
Posts: n/a

Default Re: regexp_like weirdness in 10G? - 02-14-2010 , 04:44 PM



On Feb 14, 4:46*pm, "Vladimir M. Zakharychev"
<vladimir.zakharyc... (AT) gmail (DOT) com> wrote:
Quote:
On Feb 14, 11:55*pm, Ken Quirici <kquir... (AT) yahoo (DOT) com> wrote:





I'm getting this column contents (the column is a varchar2(200)):

'K+CS2(26)/DP'

matched by this:

regexp_like(<col-name>,'^(\d)+\(B|\d\).*DP.*')

Just in case, I also returned the column length and got 12, which is
exactly the number of
characters between the single quotes.

I thought '^' meant start-of-string, in this case, start-of-database-
column-string, so I
should not be getting a match with a string starting with 'K+CS'

When I remove the '^' I get exactly the same results.

I'm running this test in TOAD.

Unless the booze really got hold of me, your RE says: either "^(\d)+\
(B" or "\d\).*DP.*". "\d\).*DP.*" (a digit followed by literal ")",
then at least one character, then literal "DP", then at least one
character - note that end-of-line counts as a character here)
perfectly matches the input.

RE is not for the faint-hearted. In fact, you need to be very precise
in what you're after...

Regards,
* *Vladimir M. Zakharychev
* *N-Networks, makers of Dynamic PSP(tm)
* *http://www.dynamicpsp.com- Hide quoted text -

- Show quoted text -
Yup. I inserted () around my B|\d to get \((B|\d)\)
and it worked like a charm!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.