#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
use Encode;
use re qw[eval debugcolor];

pod2usage 2 if !GetOptions help => \my $help or @ARGV != 2;
pod2usage 1 if $help;

my ($str, $regex) = map { decode 'UTF-8', $_ } @ARGV;
$str =~ /$regex/;

=head1 NAME

reg - re 'debug' wrapper

=head1 VERSION

version 1.0.1

=head1 SYNOPSIS

  reg [options] [string] [regex]

  Options:
    -help            brief help message

=head1 OPTIONS

=over 8

=item B<-help>

Print a brief help message and exits.

=back

=head1 DESCRIPTION

B<This program> tries to match regex to string and shows Perl regular
expression debugger output.

=head1 AUTHOR

Konrad Borowski <glitchmr@myopera.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Konrad Borowski.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

