![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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 - |
#4
| |||
| |||
|
|
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 - |
![]() |
| Thread Tools | |
| Display Modes | |
| |