package PERLANCAR::JSON::Match;
our $DATE = '2016-02-18'; # DATE
our $VERSION = '0.02'; # VERSION
use 5.010001;
use strict;
use warnings;
#use Data::Dumper;
require Exporter;
our @ISA = qw(E
xporter);
our @EXPORT_OK = qw(match_json);
our $MATCH_JSON = qr{
(?&VALUE) (?{ $_ = $^R->[1] if 0 })
(?(DEFINE)
(?<OBJECT>
#(?{ [$^R, {}] })
\{\s*
(?: (?&KV) # [[$^R, {}], $k, $v]
# (
h_json {
state $re = qr/\A$MATCH_JSON\z/;
shift =~ $re ? 1:0;
}
1;
# ABSTRACT: Match JSON string using regex
__END__
=pod
=encoding UTF-8
=head1 NAME
PERLANCAR::JSON::Match - Match JSON