Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > Re: regexp_subs...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 6867 of 7201
Post > Topic >>

Re: regexp_substr help, please

by md <mardahl2000@[EMAIL PROTECTED] > Apr 29, 2008 at 09:33 AM

On Apr 29, 10:34 am, spamb...@[EMAIL PROTECTED]
 (Doug Miller) wrote:
> I need to be able to pull just the last name out of a string consisting
of
> lastname and firstname, separated by a comma, or space, or comma and
space.
> Complicating matters somewhat is the fact that lastname might be
something
> like "Mc Kay" or "St. Louis" so simply grabbing everything before the
first
> space isn't sufficient.
>
> The closest I've come so far is
>         select regexp_substr ('St. Louis, Ted', '.{4}[A-Z]+') from dual;
> but this returns only
>         St. L
>
> I thought regular expression matching was supposed to be "greedy", and
take as
> many characters as would satisfy the pattern ("St. Louis" in this case).
>
> What am I doing wrong?

These are you combos?

ln,fn|ln, fn|ln fn
l n,fn|l n, fn|l n fn

I'd start by nuking the fn.  It's the last solid string and it has an
nice anchor fn$
 




 6 Posts in Topic:
regexp_substr help, please
spambait@[EMAIL PROTECTED  2008-04-29 15:34:24 
Re: regexp_substr help, please
md <mardahl2000@[EMAIL  2008-04-29 09:33:53 
Re: regexp_substr help, please
yf110@[EMAIL PROTECTED]   2008-04-29 09:43:23 
Re: regexp_substr help, please
spambait@[EMAIL PROTECTED  2008-04-29 16:56:40 
Re: regexp_substr help, please
md <mardahl2000@[EMAIL  2008-04-29 09:52:28 
Re: regexp_substr help, please
Peter Nilsson <airia@[  2008-04-29 20:17:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 13:55:07 CDT 2008.