help with parsing

I have the following data for example.   There are eight data fields; ID, name, race, gender, age (dob), SSN, phone and address.  They always appear in the same order.

1   smith, mary   Black/African American    Female   37 (12/08/1977)     *****1234     267-111-2222      1111 Main Street, Perkasie PA, 19144

Is there a way using regular expressions to parse this?   The ID field is numeric.  I know all the possible values for race and gender.  The SSN will have ***** with only the last 4 visible.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Could you provide few more records. Are these comma separated?
HLRosenbergerAuthor Commented:
not comma separated.   I wish they were!!
Are they Tab delimited or is there a fixed number of spaces between fields
Shahan AyyubSenior Software EngineerCommented:
I would like to offer the following regex that uses named groups:

(?<id>\d+)\s+(?<name>.+?)\s+(?<race>Black\/African American|otherraces)\s+(?<gender>female|male)\s+(?<age>\d+\s\S+)\s+(?<ssn>\*+\d{4})\s+(?<phone>[+\d\-\(\)]+)\s+(?<address>.+)

Open in new window

Notice the otherraces in the pattern, it should include the possible values of other races.

It gives me result like:
id             1
name      smith, mary
race              Black/African American
gender      Female
age              37 (12/08/1977)
ssn              *****1234
phone      267-111-2222
address      1111 Main Street, Perkasie PA, 19144


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
HLRosenbergerAuthor Commented:
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.