This code:
use strict;
use warnings;
use YAPE::Regex::Explain;
print YAPE::Regex::Explain->new( qr/d+/ )->explain();
prints
The regular expression:
(?-imsx:d+)
matches as follows:
NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with ^ and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
d+ 'd' (1 or more times (matching the most
amount possible))
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
but this code
use 5.014; #added this
use strict;
use warnings;
use YAPE::Regex::Explain;
print YAPE::Regex::Explain->new( qr/d+/ )->explain();
prints only:
The regular expression:
matches as follows:
NODE EXPLANATION
----------------------------------------------------------------------
What’s wrong?
Feature
unicode_stringschanges which pattern gets created.YAPE::Regex::Explain can’t handle many new (and not so new) features due to lack of maintenance. This is documented in the LIMITATIONS section.
I bet it gets the flags using
re::regexp_pattern(explaining why it displays(?-imsx:d+)instead of(?^:\d+)), and chokes on the “u” flag it doesn’t know about.