|
|
| Do you know where your variables are? | |
| PerlMonks |
How to use "less than" and "greater than" inside a regex for a $variable numberby Polyglot (Monk) |
| on Oct 01, 2012 at 19:56 UTC ( #996728=perlquestion: print w/ replies, xml ) | Need Help?? |
|
Polyglot has asked for the
wisdom of the Perl Monks concerning the following question:
Background: I'm trying to parse some text for page numbers, and some page numbers are missing. The original book may not have had a number on every page, so the skipped pages may be legitimate. However, due to variations in the HTML, some page numbers may have been missed by the parser. So I'm creating a regex to find possible skips so as to tag them properly.
Pages which have already been identified will be tagged in the format of (<a id="GC_2"></a>) where the "GC" is the book code and the number is the page. There is little point in looking for a skipped page out of its range, so I'm trying to match only between these tags where the page should be. Code example:
Here is a sample of the output that gets pushed into @findmissing to help me scan for legitimate missed numbers (neither of these was a page number, as evidenced by the context). UPDATE: It appears this is not possible in perl. At least, I have not found a way to do this. What I have found is of limited value, but may help me to find the majority of cases...ugly as anything, though. I'm now doing this... Oh, and this is slow as molasses Blessings, ~Polyglot~
Back to
Seekers of Perl Wisdom
|
|
|||||||||||||||||||||||||||||||||