Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Carat placement in regular expression list

2776946Apr 4 2015 — edited Apr 4 2015

I wanted to know what is the difference between placing the carat in front of a parentheses enclosing a search pattern and placing the cara immediately following it

for example

SELECT ADDRESS2,

REGEXP_REPLACE(ADDRESS2,

'(^[[:alpha:] ]+), ([[:alpha:]]{2}) ([[:digit:]]{5})',

'\3 \2-"\1"') THE_STRING

FROM ORDER_ADDRESSES

and

CHECK (

REGEXP_LIKE (EMAIL1,

'^([[:alnum:]]+)@[[:alnum:]]+.(com|net|org|edu|gov|mil)$'

)

)

does the first example imply that [[:alpha:] ]+  is the first string in the following sets of strings

while the second implies that

([[:alnum:]]+)@[[:alnum:]]+.(com|net|org|edu|gov|mil)  is the string between       ^ and $




Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2015
Added on Apr 4 2015
1 comment
280 views