Regular Expression to find US phone numbers missing Area Code

Hello all,
I have a regular expression that can find US Phone Numbers containing various formatting as shown:
[\(.]?[2-9]\d\d[\).]?[ -]?[2-9]\d\d[-.]\d{4}

results:
(xxx) xxx.xxxx
xxx-xxx-xxxx
xxx xxx xxxx

I'm trying to adjust the regular expression, so that it only finds phone numbers MISSING the area code.  Therefore the phone number in sample text like this would be flagged:

This is a test phone number missing area code: 123-4567.  

The following phone number would not be flagged:

This is a test phone number containing area code: (123) 123-4567.

Thanks in advance.
peerlesslvAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
^[2-9]\d\d[-.]\d{4}
0
peerlesslvAuthor Commented:
thanks ozo, but when i test the regular expression it only captures phone numbers that have no text before it.  This returns ok:
xxx-xxxx

However, this doesn't return when it should:
text text xxx-xxxx.
0
ozoCommented:
^\D*[2-9]\d\d[-.]\d{4}
will return phone numbers that have no numbers before it,
but if you have two phone numbers like
(123) 123-4567.    123-4567
it won't return the second one.
If you need to handle those cases, it may help to know what regular expression implementation you are using, since it could be useful to use some constructs that not all implementation support
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
peerlesslvAuthor Commented:
Thanks.  This works great.  I'm using the utility PowerGrep.  
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Regular Expressions

From novice to tech pro — start learning today.