Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I have only a few "branches" (alternations) for the forward-looking assertion. But how would I put a capture group there? In any case, I've made several attempts at this now with no success. For some reason the match always ends at the earliest possible alternation, apparently recognizing the (.*?) in the separate branches as being equal. Going to an unqualified greedy capture would not work either, as that would potentially slurp entire paragraphs instead of sentences until a match would be found--combining chunks that should remain separate.

For my part, any way that will do the job works for me. I don't mind, for a one-time-use script like this, writing pages of messy looking code that is inefficient, ugly, whatever--if so long as it would get the job done! So having a large number of capture variables is a non-issue. I've sometimes gone above 30 on those for a job of this nature! But in this particular case, that is not going to solve the problem.

Blessings,

~Polyglot~


In reply to Re^6: How to enforce match priority irrespective of string position by Polyglot
in thread How to enforce match priority irrespective of string position by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found