Dear Monks,

I'm stuck on "delayed-regex assertions" here.

Can "delayed-regex assertions" be nested with perl v5.8.6 built for MSWin32-x86-multi-thread on win xp SP2 32bit?

When I tried this I get:
Sequence (?{...}) not terminated or not {}-balanced in regex; marked by <-- HERE in m/(??{ <-- HERE join( '|', grep ( /

I gave anonymous sub routines a shot but didn't get far there.

Code example:

<code> use Data::Dumper;
my @A = ( "ab", "abcd", "f" );
my %H = (
'ab' => 0,
'abcd' => 1,
#'def' => 2,
);

# 1st working alternative
foreach $i (@A){if (!(grep (/$i/i, keys %H))){print "$i\n";};};


# 2nd working alternative
@B = grep ( /(??{join( '|', @A)})/gi, keys %H );
@B = grep ( !/(??{join( '|', @B)})/gi, @A );

# Imagined Code with the issue
# @B = grep ( !/(??{join( '|', grep ( /(??{join( '|', @A)})/gi, keys %H ) })/gi, @A );

# Issue Code Perl -c output
# Sequence (?{...}) not terminated or not {}-balanced in regex; marked by <-- HERE in m/(??{ <-- HERE join( '|', grep ( /
print "Delta:\n";
print Dumper(@B);


##Output
##Delta:
##$VAR1 = 'f';
< /code>


Many, many thanks in advance.

ddn123456

In reply to Can "delayed-regex assertions" be nested... by ddn123456

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.