Click here to get back home

RegEx - matching previous match

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
RegEx - matching previous match j ellings 02-27-2008
Posted by dummy on February 28, 2008, 5:03 am
Please log in for more thread options
On Wed, 27 Feb 2008 14:12:56 -0800 (PST), j ellings

>Hello.
>
>I have an html file converted from PDF that includes the following
>sample lines:
>
[snip]
>
>I am trying to capture the information between the <i><b>
>tags as these are the only unique delimiters between entries.
>
>My regex is as follows:
>
>while ($html =~ mgs) {
>#do something
>}
>
>Unfortunately, the regex will match the first instance( Z & A
>Newsstand), but ignore the second (Newstand) and then match on the
>third (Pudgies Deli).
>
>I can see that the match is working according to what I wrote; I am
>trying to fine tune it so that I can grab every match. Is there a way
>to include the previous <i><b> in the next match such that
>it will not skip a potential match?
>
>Any suggestions or advice would be most appreciated.
>
>John


while ($html =~ mg){print "$1\n"}

works for me

Similar ThreadsPosted
RegEx - matching previous match February 27, 2008, 5:12 pm
Multi-Match (to Array) Regex with a precodition match? August 5, 2007, 2:43 pm
Regex not matching May 15, 2005, 4:37 am
REGEX NAME Matching.. June 23, 2005, 5:11 pm
RegEx Help, Please? (match after n) June 26, 2005, 10:49 pm
regex to match any url February 14, 2006, 4:02 pm
Matching substrings within a Regex May 16, 2006, 12:41 pm
regex matching exactly 10 digits November 28, 2006, 8:58 am
get the matching regex pattern March 20, 2008, 9:16 am
regex back matching June 5, 2008, 8:53 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap