Pattern for a regular expression

Hi.

I would like some help with a pattern for a regular expression.   The string that I need to find will always have 3 or more "/" characters in the string surrounded by alphanumeric characters.   By that rule, the first or last character cannot be "/".

Between each "/" character, there would be a number of alphanumeric characters but the number of characters and their composition of those characters does vary.

There are no spaces in the string. All the characters are numbers or letters.  By example the string being sought might look like the following.

204A/abcd23/1124343/abc53/213c

 Thank you for your help.
peispudAsked:
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.

Russ SuterCommented:
(?:\w+[/]{1}){3,}\w+

Open in new window

translates as
match the following expression but don't capture it
(
Alphanumeric, one or more repetitions
A / character, exactly once
)
the above group at least 3 times followed by
Alphanumeric, one or more repetitions

Or...
^((?:\w+[/]{1}){3,}\w+)(?![/])$

Open in new window

This is a full string match and will only produce a match if the above conditions are met AND
 - the entire string matches
 - the last character in the string is not a / character
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
peispudAuthor Commented:
Perfect!   You gave me two great answers with explanation.  

Thank you!
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.