Regular Expression to repeat matching in a phrase

I don't think my title for this question is very good.  Hopefully people will notice this question.

If I have a phrase such as this: "You must be enrolled in the School of Business and be a student with junior or senior standing."

I'd like to use regexp to parse out "junior" and "senior".  In this case, they are separated by "or", which can be tossed out.  Here is my regexp so far:

/^You must be enrolled in the School of Business and be a student with\s*((?:junior|senior|(?=\s*or\*))).*\s*standing.$/g

I'm only getting "junior" for this.

If I manipulate it a little bit with this regexp:

/^You must be enrolled in the School of Business and be a student with\s*(((?:junior|senior)|(?=\s*or\*))).*\s*standing.$/g

I get:
junior
junior

Is there a way to get this result:

junior
senior

I will expect that I could possibly have junior or senior or junior and senior phrases and even through in freshman and/or sophomore.  So I'm trying to parse out those tokens.

Another alternative would be to just grab the phrase, e.g.

junior or senior
junior and senior
sophomore or junior or senior
sophomore and junior or senior
etc.

So it would be something like ((?:freshman|sophomore|junior|senior|?=(?:and|or))

If I have the whole phrase, I can programatically split the string into tokens instead of having a regex return the individual tokens.  I think either approach will work for me.
mock5cAsked:
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:
/^You must be enrolled in the School of Business and be a student with\s*(?:(junior)|(senior)|\s*or\s*)*\s*standing.$/
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
mock5cAuthor Commented:
It only seems to be capturing "senior".  I'm using http://www.regexr.com/ to test.
0
ozoCommented:
> I'm using http://www.regexr.com/ to test.
That may be your problem.

/^You must be enrolled in the School of Business and be a student with\s*(junior)(?:\s*or\s*)(senior)\s*standing.$/
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.