Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

You're right it is. Where we differ is that your Array::PatternMatcher separates extractions from assertions and only borrows from the regex syntax. It's the sort of thing that we all know full well can be implemented by adding code. I'm looking at it sort of like exchanging m/^\d+$/ for sub is_numeric { for (split //) { return unless ord($_) >= ord('0') and ord($_) <= ord('9') } return 1 }. Or at least that's how it looks on the surface after reading your POD once.

I'm just thinking it'd be a big win to be able to specify regular expressions in more than one dimension. Following on my original meditation I think perhaps I mislead myself. I think the proper multi-d regex is only going to have a new operator such that it tells the engine to go perpendicular and in which direction. A 2-d example would be an instruction to turn right at a certain point. 3-d might mean to start going up. I think the rest of the meaning makes the most sense when you think of multi-d as a tangled one-d space. A normal regex already goes one character/byte at a time, there's no reason to drop that (and that is what I originally proposed with the idea of skipping around). So maybe that means giving the \[{dimension,direction} sequence *just* a dimension and direction parameter.

Initially I thought I'd need to rebind the regular expression at will to hop around to different array elements. I think instead... maybe when the engine isn't doing a normal 1-d regex that it'd need to run custom code that isn't regex at all to follow the data around. So this brings up the question - I've not seen a Regex tokenizer around (not that I've looked that hard either). Maybe with one of those an a controlling function you could jump around, test atoms and when possible use the normal regex engine.

If this isn't clear then someone please let me know.

__SIG__ use B; printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE;

In reply to Re^2: Multidimensional regular expressions by diotalevi
in thread Multidimensional regular expressions by diotalevi

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (1)
    As of 2021-04-17 00:11 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found