NAME

regexp_opt - Convert list of strings to a regular expression

SYNOPSIS

use List::Regexp qw(:all);

my $s = regexp_opt(@strings);

my $s = regexp_opt(\%opts, @strings);

DESCRIPTION

Return a regexp to match a string in the list @strings. First argument can be a reference to a hash, which controls how the regexp is built. Valid keys are:

type => pcre|posix|emacs

Controls the flavor of the generated expression: Perl-compatible (the default), POSIX extended, or Emacs.

match => default|exact|word

If default, the expression will match any word from @strings appearing as a part of another word.

If exact, the expression will match a word from @strings appearing on a line alone.

If word, the expression will match single words only.

debug => 0|1

If 1, enable debugging output.

group => 0|1

If 1, enclose entire regexp in a group.

AUTHORS

Sergey Poznyakoff <gray@gnu.org>