Regular Expressions- Making a Backreference

I'm trying to make a Regex with backreferences- and I'm not very familiar with backreferencing.
Here's an example that I'm running the regex against.

"The legal description is Township 27 South, Range 23 East, Sections 1, 10, 11, 12, 15, 19, 20,
21, and 22; Township 27 South, Range 24 E., Section 6; Township 26 South, Range 23 East, Sec. 1,
2, 11, 13, 14, 24, 25, and 36; Township 26 South, Range 24 East, Sec 31; and Township 25 South,
Range 23 East, Sections 25, 35, and 36.  The survey area..."

In which I want returned:
Township 27 South, Range 23 East, Sections 1, 10, 11, 12, 15, 19, 20, 21, 22
Township 27 South, Range 24 East, Section 6
Township 26 South, Range 23 East, Sections 1, 2, 11, 13, 14, 24, 25, 36
Township 26 South, Range 24 East, Section 31
Township 25 South, Range 23 East, Sections 25, 35, 36

I'm having trouble in getting all of the numeric entries under 'Sections'and I guess I need to use
a backreference, but am unsure exactly how to do so.

Here are the Regex's I have so far.
(?<township>\btownship\s?\d{1,2}\s?(s(outh)?|n(orth)?))(?:,?\s?)
(?<range>\brange\s?\d{1,2}\s?(e(ast)?|w(est)?))(?:.?,?\s?)
(?<section>\bsec(\.?)(tion)?(s?)\s?\d{1,2})

which returns:
Township 27 South, Range 23 East, Sections 1
Township 27 South, Range 24 E., Section 6
Township 26 South, Range 23 East, Sec. 1
Township 26 South, Range 24 East, Sec 31
Township 25 South, Range 23 East, Sections 25
Township 13 North, Range 16 East, sec. 32

How do I construct the Regex for the <section> group to match all numbers that fall within this
area?
Thanks for your help!
montarchAsked:
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.

ddrudikCommented:
Consider this example:
http://www.myregextester.com/?r=8b558af7

I modified your pattern, see if it fits your source.  Note that instead of \s? I changed it so \s* to make a CRLF that you had in that location within the source data, that may need to be required elsewhere based on the variance in your source text.

See this example for a more restrictive definition of Section:
http://www.myregextester.com/?r=20b9df1c
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
montarchAuthor Commented:
Absolutely PERFECT!  Once again, you've saved and humbled me.

Thanks again!

0
ddrudikCommented:
Glad I could help.  Thanks for the question and the points.
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.