You are right on all counts. I do not know why the extra brackets are needed. I must sleep on it.

:)

qr{\A ipv6 | alt \Z}imxs

Its either begin string with ipv6

or end string with alt

other regex tools, ppixregexplain.pl ...

$ perl -MYAPE::Regex::Explain -e " print YAPE::Regex::Explain->new( qr +{\A ipv6 | alt \Z}imxs )->explain " The regular expression: (?imsx:\A ipv6 | alt \Z) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?imsx: group, but do not capture (case-insensitive) (with ^ and $ matching start and end of line) (with . matching \n) (disregarding whitespace and comments): ---------------------------------------------------------------------- \A the beginning of the string ---------------------------------------------------------------------- ipv6 'ipv6' ---------------------------------------------------------------------- | OR ---------------------------------------------------------------------- alt 'alt' ---------------------------------------------------------------------- \Z before an optional \n, and the end of the string ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------

rxrx

[Visual of regex at 'rxrx' line 0] [step: 5] \A Match only if at start of string ipv6 Match a literal sequence ("ipv6") | Or... alt Match a literal sequence ("alt") \Z Match only if at end of string (or final new +line)

In reply to Re^3: Roughly matching an ipv6 address with sql wildcard by Anonymous Monk
in thread Roughly matching an ipv6 address with sql wildcard by neilwatson

Title:
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, details, 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, summary, 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.