Wrox Programmer Forums
|
BOOK: Beginning Regular Expressions
This is the forum to discuss the Wrox book Beginning Regular Expressions by Andrew Watt; ISBN: 9780764574894
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Regular Expressions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2008, 04:27 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to get multiple matches

Dear friends,

 I am writing following regex: (http\:\/\/news.*\&amp\;url\=)


to extract 2 matches from:

 <url>http://news.thirdparty.com/intl/en_us/images/news_res.gif</url><link>http://news.thirdparty.com/</link></image><item><title>State Department - Hindu</title><link>http://news.thirdparty.com/news/url?sa=T&amp;ct=us/0-0&amp;fd=R&amp;url=http://www.hindu.com/thehindu/holnus/000200810090926.htm&amp;cid=1253751878&amp;ei=5LXt SOjOAqGO6AP9yby5Ag&amp;usg=AFQjCNGAkpKActP6yAiup4V QxtkMZrEbjA</link><pubDate>Thu, 09 Oct 2008 03:51:34 GMT</pubDate>&lt;a href="http://news.thirdparty.com/news/url?sa=T&amp;ct=us/0-0&amp;fd=R&amp;url=http://www.hindu.com/thehindu/holnus/000200810090926.htm&amp;cid=1253751878&amp;ei=5LXt SOjOAqGO6AP9yby5Ag&amp;usg=AFQjCNGAkpKActP6yAiup4V QxtkMZrEbjA"&gt;



But it is giving one match. Please guide me.


 
Old October 9th, 2008, 02:18 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Well, you don't show the code you are using to extract the matches. You don't even say what language you are using.

So it's tough to guess. It might be as simple as you forgetting to specify "global" to the regexp search.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying 1 to 9 of 9 matches kumiko Classic ASP Basics 2 February 21st, 2008 05:12 PM
Select first child node that matches criteria priya81 XSLT 4 July 3rd, 2007 10:32 AM
matches without repeated items pongup BOOK: Beginning Regular Expressions 0 April 7th, 2007 09:05 PM
Select node whose child value matches Fantmx XSLT 5 February 16th, 2007 04:54 PM
Make sure the class defined in this file matches . Tawanda BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 September 20th, 2006 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.