By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

Narrowing down RegExp SubExpressions??

P: n/a
Here's the deal, the following expression only displays a range.
Sometimes the text I'm searching has more that one returned Grouping
I need to return only one group by adding to the expression below.

------------------------------
Example Text:

# Beginning of file

Persons_Name: John
Address: Somewhere 111
City: Someplace
Zip: 98654

Persons_Name: John
Address: Somewhere 222
City: Someplace
Zip: 98654

# End of file
-------------------------------
Using this Expression w/ SingleLine Option:
(Address:).+?(City:).+?(\n)

would return two groups
--------------------------------
(Group1)
Address: Somewhere 111
City: Someplace

(Group2)
Address: Somewhere 222
City: Someplace
---------------------------------
If I know one of the groups contains (Somewhere 222),
I want to input the (Somewhere222) into the expression,
(Address:).+?(City:).+?(\n)
to only receive the matching range.

This is only an example to help anyone to understand the concept.
Thanks in advance,
Sterling
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.